Usenet comp.sys.dec (1990-2013)
 help / color / mirror / Atom feed
* compiler internal error in building xemacs-20.x
@ 1997-04-25  4:00 Toshinao Ishii
       [not found] ` <m2n2qnx96y.fsf@altair.xemacs.org>
  1997-05-01  4:00 ` Jeff Sullivan USG
  0 siblings, 2 replies; 6+ messages in thread
From: Toshinao Ishii @ 1997-04-25  4:00 UTC (permalink / raw)



Hi.

I tried to compile xemacs-20.2-b2 on Digital UNIX 4.0a and
found that its C compiler fails to compile abbrev.c because
of compiler internal error. Do you know whether there is
a way to get over this problem ? (Of course I am reporting
this problem to the people with whom we have support contract.)

-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
^[$B@P0f=SD>^[(B Toshinao Ishii
	email:  ici@osk.threewebnet.or.jp (NeXTMail/MIME Welcome)

	




^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: compiler internal error in building xemacs-20.x
       [not found] ` <m2n2qnx96y.fsf@altair.xemacs.org>
@ 1997-04-28  4:00   ` Joe Mario
  0 siblings, 0 replies; 6+ messages in thread
From: Joe Mario @ 1997-04-28  4:00 UTC (permalink / raw)
  To: Steven L Baur


Steven L Baur wrote:
> 
> Toshinao Ishii <ici@osk.threewebnet.or.jp> writes:
> 
> > Hi.
> > I tried to compile xemacs-20.2-b2 on Digital UNIX 4.0a and
> > found that its C compiler fails to compile abbrev.c because
> > of compiler internal error. Do you know whether there is
> > a way to get over this problem ?  
...
> When recompiling the files by
> hand, use the old C compiler for the following versions of Digital UNIX:
>   - V3.n: Remove "-migrate" from the compile command.
>   - V4.n: Add "-oldc" to the compile command.
 
Steven or Toshinao:
	Can you mail the offending preprocessed file to me along with
	the compile command line?  This is the first we've heard of 
	this problem.   Whatever the problem is, I'd like to get it
	fixed.

Thanks,
Joe Mario
DEC C development team.
mario@zk3.dec.com



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: compiler internal error in building xemacs-20.x
  1997-04-25  4:00 Toshinao Ishii
       [not found] ` <m2n2qnx96y.fsf@altair.xemacs.org>
@ 1997-05-01  4:00 ` Jeff Sullivan USG
  1997-05-01  4:00   ` Steven L Baur
  1 sibling, 1 reply; 6+ messages in thread
From: Jeff Sullivan USG @ 1997-05-01  4:00 UTC (permalink / raw)
  To: Toshinao Ishii


We were able to reproduce the problem and are now investigating a
compiler fix. There appears to be a problem in the xemacs abbrev.c
source code, given the preprocessed file that you sent us.

Below is the (simplified) code that is causing the compiler error:

int SYNTAX_CODE (struct Lisp_Char_Table *table, int c) {
    return ((((c) < 160 ? (table)->ascii[c] :
              CHAR_TABLE_NON_ASCII_VALUE_UNSAFE (table, c))).val);
}

There appears to be a few problems with this:
   
     - the function returns "int" (in the original)
     - (table)->ascii[c] is of type "Lisp_Object"
     - CHAR_TABLE_NON_ASCII_VALUE_UNSAFE (table, c))).val
       is of type "long"

To see the a compilation error (not internal error), try:

FIX1 : Change the function to return "Lisp_Object"
       A compile error is generated for the conditional expression
       (I think this is acceptable)

FIX2 : Change the conditional expression to an if/then/else
       A compile error is generated for the returns, since the
       types do not match "int".
       (I think this is acceptable)

Note that with either of these "fixes", it will point to a
real source code problem and ultimately, the source code should
be fixed.

If you could, please send me a non-preprocessed version of this
same file/routine, so we can determine how the source code should
be changed.

Thanks,
-Jeff

-- 
Jeff Sullivan | Digital Equipment Corp | sullivan@decc.enet.dec.com
DEC C and C++ | Nashua, NH  ZK3-2/2X09 |     or     jps@zk3.dec.com



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: compiler internal error in building xemacs-20.x
  1997-05-01  4:00 ` Jeff Sullivan USG
@ 1997-05-01  4:00   ` Steven L Baur
  0 siblings, 0 replies; 6+ messages in thread
From: Steven L Baur @ 1997-05-01  4:00 UTC (permalink / raw)
  To: Jeff Sullivan USG, ici


Major question:  Does this compiler internal error still happen if the 
configuration option `use-union-type=yes' is used?


Jeff Sullivan USG <jps@quarry.zk3.dec.com> writes:

> We were able to reproduce the problem and are now investigating a
> compiler fix. There appears to be a problem in the xemacs abbrev.c
> source code, given the preprocessed file that you sent us.

> Below is the (simplified) code that is causing the compiler error:

> int SYNTAX_CODE (struct Lisp_Char_Table *table, int c) {
>     return ((((c) < 160 ? (table)->ascii[c] :
>               CHAR_TABLE_NON_ASCII_VALUE_UNSAFE (table, c))).val);
> }

This appears to be the expansion of the macro

#define CHAR_TABLE_VALUE_UNSAFE(ct, ch)		\
  ((ch) < NUM_ASCII_CHARS			\
   ? (ct)->ascii[ch]				\
   : CHAR_TABLE_NON_ASCII_VALUE_UNSAFE (ct, ch))

in chartab.h.  NUM_ASCII_CHARS is 160 when compiled with MULE.  This
macro should return type Lisp_Object, as the ascii field is an array
of Lisp_Object,

struct Lisp_Char_Table
{
  struct lcrecord_header header;

  Lisp_Object ascii[NUM_ASCII_CHARS];

#ifdef MULE
  Lisp_Object level1[NUM_LEADING_BYTES];

#endif /* MULE */

  enum char_table_type type;

  /* stuff used for syntax tables */
  Lisp_Object mirror_table;
  Lisp_Object next_table; /* DO NOT mark through this. */
};

and the macro CHAR_TABLE_NON_ASCII_VALUE_UNSAFE similarly returns
type Lisp_Object.

INLINE Lisp_Object
CHAR_TABLE_NON_ASCII_VALUE_UNSAFE (struct Lisp_Char_Table *ct, Emchar ch)
{
  unsigned char lb = CHAR_LEADING_BYTE (ch);
  if (!CHAR_TABLE_ENTRYP ((ct)->level1[lb - MIN_LEADING_BYTE]))
    return (ct)->level1[lb - MIN_LEADING_BYTE];
  else
    return get_non_ascii_char_table_value (ct, lb, ch);
}

Lisp_Object get_non_ascii_char_table_value (struct Lisp_Char_Table *ct,
					   int leading_byte,
					   Emchar c);

> There appears to be a few problems with this:
   
>      - the function returns "int" (in the original)

Yes, but it is converted to int in syntax.h:

#define SYNTAX_CODE_UNSAFE(table, c) \
   XINT (CHAR_TABLE_VALUE_UNSAFE (table, c))

INLINE int SYNTAX_CODE (struct Lisp_Char_Table *table, Emchar c);
INLINE int
SYNTAX_CODE (struct Lisp_Char_Table *table, Emchar c)
{
  return SYNTAX_CODE_UNSAFE (table, c);
}

XINT is #defined from XREALINT in lisp.h.

#define XINT(obj) XREALINT (obj)

The implementation of XREALINT depends on whether lisp unions are
used.  The following definition is used if lisp unions are not used.

# define XREALINT(a) (((a) << (LONGBITS-VALBITS)) >> (LONGBITS-VALBITS))

>      - (table)->ascii[c] is of type "Lisp_Object"
>      - CHAR_TABLE_NON_ASCII_VALUE_UNSAFE (table, c))).val
>        is of type "long"

This may be confusion from not compiling with Lisp_Object as a union.

> To see the a compilation error (not internal error), try:

> FIX1 : Change the function to return "Lisp_Object"
>        A compile error is generated for the conditional expression
>        (I think this is acceptable)

> FIX2 : Change the conditional expression to an if/then/else
>        A compile error is generated for the returns, since the
>        types do not match "int".
>        (I think this is acceptable)

> Note that with either of these "fixes", it will point to a
> real source code problem and ultimately, the source code should
> be fixed.

O.K.

> If you could, please send me a non-preprocessed version of this
> same file/routine, so we can determine how the source code should
> be changed.

It's difficult to impossible to separate this stuff apart given the
heavy (over)use of macros.  The full source code is at
ftp://ftp.xemacs.org/pub/beta/xemacs-20.2/.  Perhaps Ishiisan can tar
up a copy of his src directory after running configure and creating
src/config.h and src/Makefile (I can't -- I have no access to this
architecture).

-- 
steve@miranova.com baur
Unsolicited commercial e-mail will be billed at $250/message.



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: compiler internal error in building xemacs-20.x
@ 1997-05-12  4:00 Joe Mario
  1997-05-14  4:00 ` Steven L Baur
  0 siblings, 1 reply; 6+ messages in thread
From: Joe Mario @ 1997-05-12  4:00 UTC (permalink / raw)



We have a patched DEC C compiler that fixes the compiler crash
that occurs when building the xemacs abbrev.c file.  
The crash was reported earlier in this newsgroup.  See the README
below for details.

Joe Mario
DEC C compiler group.
 

--

May 8, 1997
README.txt for V5.2-038:

This compiler is DEC C V5.2-038

This version of the DEC C for UNIX compiler is designed for use only
on Digital UNIX V4.0 through V4.0C systems.  It is being made 
available over the internet via anonymous ftp to provide wide
availability quickly because of the large number of users likely
affected by the compiler crash when building xemacs.

It is also being submitted to the Digital UNIX support pools, and 
will be available through normal support channels in the future.

The file you are reading is available through the web as URL

  ftp://gatekeeper.dec.com/private/decc/UNIX/V5.2-038/README.txt

and the compressed compiler image is available as:

 
ftp://gatekeeper.dec.com/private/decc/UNIX/V5.2-038/gemc_cc.V5.2-038.tar.Z

Alternatively, you may download manually using anonymous ftp:

    % ftp gatekeeper.dec.com
    Name (gatekeeper.dec.com:username): anonymous
    331 Guest login ok, send ident as password.
    Password: <enter your internet address>
    ftp> binary
    200 Type set to I.
    ftp> cd /private/decc/UNIX/V5.2-038
    250 CWD command successful.
    ftp> get gemc_cc.V5.2-038.tar.Z
    200 PORT command successful.
    150 Opening BINARY mode data connection for gemc_cc.V5.2-038.tar.Z 
    226 Transfer complete.
    2517409 bytes received in 1.6e+02 seconds (15 Kbytes/s)
    ftp> quit
    221 Goodbye.
    %

To unpack and install:

    % zcat gemc_cc.V5.2-038.tar.Z | tar xvf -
    blocksize = ...
    x gemc_cc.V5.2-038, ..... bytes, .... tape blocks
    % ./gemc_cc.V5.2-038 -V
    DEC C V5.2-038 on Digital UNIX V4.0...<version detail>
    % rm gemc_cc.V5.2-038.tar.Z
    % su
    # mv /usr/lib/cmplrs/cc/gemc_cc /usr/lib/cmplrs/cc/gemc_cc.orig
    # mv gemc_cc.V5.2-038 /usr/lib/cmplrs/cc/gemc_cc

        
The specific bugs prompting the issue of this compiler are:

  1.  Compiler crash during xemacs build on Digital UNIX V4.0.
      This was reported in comp.sys.dec and comp.emacs.xemacs. 
      The current workaround is to use "cc -oldc".   

  2.  Compiler error with valid token-pasting macro.  This problem 
      was originally reported via netnews as comp.unix.osf.osf1.



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: compiler internal error in building xemacs-20.x
  1997-05-12  4:00 compiler internal error in building xemacs-20.x Joe Mario
@ 1997-05-14  4:00 ` Steven L Baur
  0 siblings, 0 replies; 6+ messages in thread
From: Steven L Baur @ 1997-05-14  4:00 UTC (permalink / raw)



Joe Mario <mario@zk3.dec.com> writes:

> We have a patched DEC C compiler that fixes the compiler crash
> that occurs when building the xemacs abbrev.c file.  
 ...
> This version of the DEC C for UNIX compiler is designed for use only
> on Digital UNIX V4.0 through V4.0C systems.  It is being made 
> available over the internet via anonymous ftp to provide wide
> availability quickly because of the large number of users likely
> affected by the compiler crash when building xemacs.

> It is also being submitted to the Digital UNIX support pools, and 
> will be available through normal support channels in the future.


Good job DEC!  Thank you!
-- 
steve@calag.com baur
Unsolicited commercial e-mail will be billed at $250/message.



^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~1997-05-14  4:00 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
1997-05-12  4:00 compiler internal error in building xemacs-20.x Joe Mario
1997-05-14  4:00 ` Steven L Baur
  -- strict thread matches above, loose matches on Subject: below --
1997-04-25  4:00 Toshinao Ishii
     [not found] ` <m2n2qnx96y.fsf@altair.xemacs.org>
1997-04-28  4:00   ` Joe Mario
1997-05-01  4:00 ` Jeff Sullivan USG
1997-05-01  4:00   ` Steven L Baur

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox