This is the mail archive of the gcc-bugs@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]
Other format: [Raw text]

[Bug optimization/14669] [3.4/3.5 Regression] Wrong code with -O for enum values expression E4 <= t && t <= E6


------- Additional Comments From roger at eyesopen dot com  2004-03-23 14:19 -------
Many thanks to Eric Botcazou for analyzing ACATS' cxa3003, which demonstrates
that the signedness recovery optimization below is unsafe.  The example is:

  unsigned char i;
  if ((long long) i <= 127)

which isn't equivalent to

  if ((signed char) i <= 127)

Hence, I'll approve and commit to mainline Kazu's orignal fix, which is attached
to comment #14.  I've confirmed this resolves this PR, and introduces no new 
testsuite failures on i686-pc-linux-gnu after a full bootstrap.  I'll also post
the patch as committed to gcc-patches explaining the check-in.

Ok for 3.4?  I need to check whether this is latent on the gcc-3_3-branch.


-- 


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


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