From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 1164f8,62452b62521434ce X-Google-Attributes: gid1164f8,public X-Google-Thread: 106243,62452b62521434ce X-Google-Attributes: gid106243,public From: Steven L Baur Subject: Re: compiler internal error in building xemacs-20.x Date: 1997/05/01 Message-ID: #1/1 X-Deja-AN: 238709014 References: <5jqo7n$3jh@news.osk.threewebnet.or.jp> <5kadds$dhe$1@nntpd.lkg.dec.com> To: jps@quarry.zk3.dec.com (Jeff Sullivan USG),ici@osk.threewebnet.or.jp X-Face: #!T9!#9s-3o8)*uHlX{Ug[xW7E7Wr!*L46-OxqMu\xz23v|R9q}lH?cRS{rCNe^'[`^sr5" f8*@r4ipO6Jl!:Ccqp:9I OSS'2{-)-4wBnVeg0S\O4Al@)uC[pD|+ Organization: XEmacs Development Team X-Url: http://www.miranova.com/%7Esteve/ X-Attribution: sb Newsgroups: comp.sys.dec,comp.emacs.xemacs Major question: Does this compiler internal error still happen if the configuration option `use-union-type=yes' is used? Jeff Sullivan USG 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.