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 kazu at cs dot umass dot edu  2004-03-21 23:34 -------
Looking at the fold()'s output (the very first one), here is my guess:

fold() is given TRUTH_ANDIF_EXPR like so

  (t > 0) && (t <= 2)

Without Roger's patch, fold() returns

  (unsigned int) (t - 1) <= 1

With Roger's patch, fold() returns

  (t - 1) <= 1.

If you plug in t = 0, the former becomes false, whereas the latter becomes true.


-- 


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]