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

kazu at cs dot umass dot edu gcc-bugzilla@gcc.gnu.org
Sun Mar 21 23:34:00 GMT 2004


------- 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



More information about the Gcc-bugs mailing list