This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Fix for --enable-checking ICE on __extension__


Right now, any use of __extension__ will cause an ICE when
--enable-checking is on.  The trouble is in c-parse.in which wraps up
an integer in a tree node for no apparent reason, and does it wrong.
The fix is to change it to use the <itype> field of yyval instead.

zw

	* c-parse.in (extension): Change token type to <itype>.
	(SAVE_WARN_FLAGS): Return a bare integer.
	(RESTORE_WARN_FLAGS): Expect a bare integer.
	* c-parse.y, c-parse.c, objc/objc-parse.y, objc/objc-parse.c:
	Regenerate.

===================================================================
Index: c-parse.in
--- c-parse.in	2000/01/30 03:44:04	1.32
+++ c-parse.in	2000/02/17 05:32:49
@@ -166,7 +166,7 @@ end ifc
 %type <ttype> init maybeasm
 %type <ttype> asm_operands nonnull_asm_operands asm_operand asm_clobbers
 %type <ttype> maybe_attribute attributes attribute attribute_list attrib
-%type <ttype> any_word extension
+%type <ttype> any_word
 
 %type <ttype> compstmt compstmt_nostart compstmt_primary_start
 
@@ -185,7 +185,7 @@ end ifc
 %type <ttype> parmlist_or_identifiers parmlist_or_identifiers_1
 %type <ttype> identifiers_or_typenames
 
-%type <itype> setspecs
+%type <itype> setspecs extension
 
 %type <ends_in_label> lineno_stmt_or_label lineno_stmt_or_labels stmt_or_label
 
@@ -229,11 +229,10 @@ static int undeclared_variable_notice;
 
 /* For __extension__, save/restore the warning flags which are
    controlled by __extension__.  */
-#define SAVE_WARN_FLAGS()	\
-	build_int_2 (pedantic | (warn_pointer_arith << 1), 0)
+#define SAVE_WARN_FLAGS() (pedantic | (warn_pointer_arith << 1))
 #define RESTORE_WARN_FLAGS(tval) \
   do {                                     \
-    int val = TREE_INT_CST_LOW (tval);     \
+    int val = tval;			   \
     pedantic = val & 1;                    \
     warn_pointer_arith = (val >> 1) & 1;   \
   } while (0)

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]