+2015-06-12 Jakub Jelinek <jakub@redhat.com>
+
+ PR middle-end/63608
+ Backported from mainline
+ 2014-05-16 Eric Botcazou <ebotcazou@adacore.com>
+
+ * fold-const (fold_unary_loc) <NON_LVALUE_EXPR>: New case.
+ <CASE_CONVERT>: Pass arg0 instead of op0 to fold_convert_const.
+
2015-06-11 John David Anglin <danglin@gcc.gnu.org>
* config/pa/pa.c (pa_output_global_address): Handle LABEL_REF plus
return fold_convert_loc (loc, type, op0);
return NULL_TREE;
+ case NON_LVALUE_EXPR:
+ if (!maybe_lvalue_p (op0))
+ return fold_convert_loc (loc, type, op0);
+ return NULL_TREE;
+
CASE_CONVERT:
case FLOAT_EXPR:
case FIX_TRUNC_EXPR:
}
}
- tem = fold_convert_const (code, type, op0);
+ tem = fold_convert_const (code, type, arg0);
return tem ? tem : NULL_TREE;
case ADDR_SPACE_CONVERT_EXPR:
+2015-06-12 Jakub Jelinek <jakub@redhat.com>
+
+ PR middle-end/63608
+ * gcc.c-torture/compile/pr63608.c: New test.
+
2015-06-11 Richard Biener <rguenther@suse.de>
Backport from mainline
--- /dev/null
+/* PR middle-end/63608 */
+
+typedef long T;
+typedef unsigned long U;
+unsigned long a;
+
+unsigned long
+foo (int b)
+{
+ T c = 0;
+ const U d = 2248593032UL;
+ a = (c = +d) | (~4L & ~b);
+ return c;
+}