optimization/6822: GCC 3.1.1 - Internal compiler error in extract_insn, at recog.c:2132

Eric Botcazou ebotcazou@libertysurf.fr
Tue May 28 16:31:00 GMT 2002


> Previously, unsigned X < 128 would be converted to unsigned X <= 127 and
> then optimized to signed X >= 0.  After changing the order of the
> transformations, the compiler only reduces the expression to X <= 127 ???
> The result is the reported ICE.  This could very well be a latent bug
> in other parts of the compiler, but it seems the change results in missed
> opportunities to simplify expressions.  I'll post an alternative patch
> in my next message...

I was almost sure to have checked the cross-dependencies between the various
blocks of code, but I overlooked this 'unsigned <= 0x7fffffff' thing... Your
patch is obviously better than mine in order to fix this chicken-and-egg
problem.

May I suggest you to add thorough cross-comments to the code ? I see you did
so for the second optimization and I think it would be nice to do it for the
first one too (saying that the current location of the optimization causes
the second one to be altered).

It looks like this doesn't fit with the GCC policy on the matter, but it
could also be worth leaving the original code inside an #if 0/#endif or a
comment.

--
Eric Botcazou
ebotcazou@multimania.com



More information about the Gcc-bugs mailing list