[Bug middle-end/31115] [4.3 regression] libstdc++ 22_locale/num_get/get/char/2.cc 27_io/basic_ostream/inserters_arithmetic/char/6.cc

rguenth at gcc dot gnu dot org gcc-bugzilla@gcc.gnu.org
Sat Mar 10 22:46:00 GMT 2007



------- Comment #11 from rguenth at gcc dot gnu dot org  2007-03-10 22:46 -------
Actually my patch is wrong as well.  We just trigger it only with ians patch as
-[-INF,-1] is [1, +INF(OVF)] with overflowed +INF.

I'll re-test the following with my previous fix for negative shift counts.

Index: tree-vrp.c
===================================================================
*** tree-vrp.c  (revision 122805)
--- tree-vrp.c  (working copy)
*************** vrp_int_const_binop (enum tree_code code
*** 1554,1559 ****
--- 1554,1565 ----
              && (sgn1 >= 0
                  ? !is_positive_overflow_infinity (val2)
                  : is_negative_overflow_infinity (val2)))
+         /* We only get in here with positive shift count, so the
+            overflow direction is the same as the sign of val1.
+            Actually rshift does not overflow at all, but we only
+            handle the case of shifting overflowed -INF and +INF.  */
+         || (code == RSHIFT_EXPR
+             && sgn1 >= 0)
          /* For division, the only case is -INF / -1 = +INF.  */
          || code == TRUNC_DIV_EXPR
          || code == FLOOR_DIV_EXPR


-- 


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



More information about the Gcc-bugs mailing list