[Bug tree-optimization/58227] wrong code (hangs) at -O3 on x86_64-linux-gnu

2013-08-23 Thread mpolacek at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58227

Marek Polacek mpolacek at gcc dot gnu.org changed:

   What|Removed |Added

 CC||mpolacek at gcc dot gnu.org

--- Comment #1 from Marek Polacek mpolacek at gcc dot gnu.org ---
I think this invokes undefined behavior in third iteration, when h is 2.  Works
with s/-2147483647/-2147483647L/.


[Bug tree-optimization/58227] wrong code (hangs) at -O3 on x86_64-linux-gnu

2013-08-23 Thread su at cs dot ucdavis.edu
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58227

--- Comment #2 from Zhendong Su su at cs dot ucdavis.edu ---
But similar to 58143, because of short circuiting (since a == 0), the
expression 0  -2147483647 - h ? 0 : 1 shouldn't be evaluated at all,
correct?  Or maybe I'm mistaken?  

Thanks for looking into this Marek!


[Bug tree-optimization/58227] wrong code (hangs) at -O3 on x86_64-linux-gnu

2013-08-23 Thread mpolacek at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58227

Marek Polacek mpolacek at gcc dot gnu.org changed:

   What|Removed |Added

 Status|UNCONFIRMED |NEW
   Last reconfirmed||2013-08-23
 Ever confirmed|0   |1

--- Comment #3 from Marek Polacek mpolacek at gcc dot gnu.org ---
Yes, sorry.  Loop invariant motion moves the condition here as well, I suppose
(works with -fno-tree-loop-im).  Thus confirmed.