Bring C++ ICE handling in line with other front ends

Mark Mitchell mark@codesourcery.com
Thu Jul 20 15:05:00 GMT 2000


Zack --

I agree that the C++ front-end should handle errors similarly to the
other front-ends.  I don't entirely agree with you about who should be
changing.

Turning signals into ICEs, or doing something similar, is good.  Users
don't care with the compiler crashed because of a SEGV or because of
an abort; they just need to know that the compiler crashed.  Giving
file and line information is good; it gives users a hint what
constructs likely caused the problem, helping them to work around
bugs.  (In C++, historically, we have not been robust in the face of
syntax errors.  I'm not defending this, but an error message with a
line number does help users deal with the problems.)  This doesn't
mask bugs; they are still reported.

I don't feel strongly about turning ICEs into fatal errors.  We should
have better error recovery, and you're right that this stuff can mask
bugs.  That portion of the patch is approved, i.e., everything but the
signal-handler stuff.

+      tree_check_failed (__t, VAR_DECL, __FILE__, __LINE__, __FUNCTION__); \
     __t; })

Leave this on two lines so it's tidy, in both places.

Make sure to change the C++ testsuite so that the new crashes are
XFAILs.

Thanks,

--
Mark Mitchell                   mark@codesourcery.com
CodeSourcery, LLC               http://www.codesourcery.com


More information about the Gcc-patches mailing list