Fix -fno-checking segfault

Michael Matz matz@suse.de
Thu Nov 19 16:13:00 GMT 2015


Hi,

in an enabled-checking compiler gcc_checking_assert is always executed.  
If that depends on things having happened under flag_checking being true, 
but it's actually false during runtime due to -fno-checking things go 
awry, like segfaulting in this case.  The fix is obvious and checked in 
after regstrapping on x86_64-linux.


Ciao,
Michael.
	* fwprop.c (update_uses): Use flag_checking instead of
	gcc_checking_assert.

Index: fwprop.c
===================================================================
--- fwprop.c	(revision 230463)
+++ fwprop.c	(working copy)
@@ -893,7 +893,8 @@ update_uses (df_ref use)
       if (DF_REF_ID (use) >= (int) use_def_ref.length ())
         use_def_ref.safe_grow_cleared (DF_REF_ID (use) + 1);
 
-      gcc_checking_assert (sparseset_bit_p (active_defs_check, regno));
+      if (flag_checking)
+	gcc_assert (sparseset_bit_p (active_defs_check, regno));
       use_def_ref[DF_REF_ID (use)] = active_defs[regno];
     }
 }



More information about the Gcc-patches mailing list