[Bug c++/22551] [4.0/4.1 Regression] [ICE] in tree_low_cst, at tree.c:3843

emailwastefilter-bugzillagccorg at yahoo dot com gcc-bugzilla@gcc.gnu.org
Mon Jul 18 18:05:00 GMT 2005


------- Additional Comments From emailwastefilter-bugzillagccorg at yahoo dot com  2005-07-18 18:03 -------
(In reply to comment #2)
> Hmm, 0x80000000+1 overflows which is invalid for constant expressions and
really should be 
> rejected.

The warnings seem on the money, but they should not cause the compiler to crash,
right?

The original code used 0xFFFE0000 in place of 0x80000000 and had around 26
warning messages before it crashed.  If there are only 4 warning messages, then
the compiler completes without crashing.  Starting with 0x80000000 - 2 lets the
compiler complete, as does commenting out one of the case statements.

Several obivous ways around this code are to use an enum, an unsigned int, or an
if-else if cascasde.  These all result in no warnings, the first two justly, the
last I'm not so sure.

-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=22551



More information about the Gcc-bugs mailing list