2008-12-02 Richard Guenther <rguenther@suse.de>
PR tree-optimization/38359
* fold-const.c (fold_binary): Fold -1 >> x to -1 only for
non-negative x.
* gcc.c-torture/compile/pr38359.c: New testcase.
* gcc.c-torture/execute/shiftopt-1.c: Adjust.
From-SVN: r142356
+2008-12-02 Richard Guenther <rguenther@suse.de>
+
+ PR tree-optimization/38359
+ * fold-const.c (fold_binary): Fold -1 >> x to -1 only for
+ non-negative x.
+
2008-12-02 Martin Jambor <mjambor@suse.cz>
PR middle-end/37861
case RSHIFT_EXPR:
/* Optimize -1 >> x for arithmetic right shifts. */
- if (integer_all_onesp (arg0) && !TYPE_UNSIGNED (type))
+ if (integer_all_onesp (arg0) && !TYPE_UNSIGNED (type)
+ && tree_expr_nonnegative_p (arg1))
return omit_one_operand (type, arg0, arg1);
/* ... fall through ... */
+2008-12-02 Richard Guenther <rguenther@suse.de>
+
+ PR tree-optimization/38359
+ * gcc.c-torture/compile/pr38359.c: New testcase.
+ * gcc.c-torture/execute/shiftopt-1.c: Adjust.
+
2008-12-02 Janus Weil <janus@gcc.gnu.org>
PR fortran/36704
if (0 >> x != 0)
link_error ();
-
- if (-1 >> x != -1)
- link_error ();
-
- if (~0 >> x != ~0)
- link_error ();
}
int