PR tree-optimization/28230
* tree-vrp.c (vrp_int_const_binop): Move flag_wrapv handling
to the correct place.
* gcc.dg/torture/pr28230.c: New testcase.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@117637
138bc75d-0d04-0410-961f-
82ee72b054a4
2006-10-11 Richard Guenther <rguenther@suse.de>
+ PR tree-optimization/28230
+ * tree-vrp.c (vrp_int_const_binop): Move flag_wrapv handling
+ to the correct place.
+
+2006-10-11 Richard Guenther <rguenther@suse.de>
+
PR inline-asm/29119
* gimplify.c (gimplify_asm_expr): Mark the gimplified lvalue
addressable.
2006-10-11 Richard Guenther <rguenther@suse.de>
+ PR tree-optimization/28230
+ * gcc.dg/torture/pr28230.c: New testcase.
+
+2006-10-11 Richard Guenther <rguenther@suse.de>
+
PR inline-asm/29119
* gcc.dg/torture/pr29119.c: New testcase.
--- /dev/null
+/* { dg-do run } */
+/* { dg-options "-fwrapv" } */
+
+void foo( unsigned long long bb, unsigned short tn, unsigned e, unsigned* w );
+void foo( unsigned long long bb, unsigned short tn, unsigned e, unsigned* w )
+{
+ unsigned n = tn + bb;
+ do {
+ e = (e > n) ? e : *w;
+ n -= (e > n) ? n : e;
+ if (*w)
+ *w = 0;
+ } while ( n );
+}
+int main()
+{
+ unsigned w = 0;
+ foo( 0, 0, 0, &w );
+ return 0;
+}
{
tree res;
- if (flag_wrapv)
- return int_const_binop (code, val1, val2, 0);
+ res = int_const_binop (code, val1, val2, 0);
/* If we are not using wrapping arithmetic, operate symbolically
on -INF and +INF. */
- res = int_const_binop (code, val1, val2, 0);
-
- if (TYPE_UNSIGNED (TREE_TYPE (val1)))
+ if (TYPE_UNSIGNED (TREE_TYPE (val1))
+ || flag_wrapv)
{
int checkz = compare_values (res, val1);
bool overflow = false;