2017-04-10 Richard Biener <rguenther@suse.de>
PR middle-end/80362
* fold-const.c (fold_binary_loc): Look at unstripped ops when
looking for NEGATE_EXPR in -A / -B to A / B folding.
* gcc.dg/torture/pr80362.c: New testcase.
From-SVN: r246805
+2017-04-10 Richard Biener <rguenther@suse.de>
+
+ PR middle-end/80362
+ * fold-const.c (fold_binary_loc): Look at unstripped ops when
+ looking for NEGATE_EXPR in -A / -B to A / B folding.
+
2017-04-10 Martin Liska <mliska@suse.cz>
PR gcov-profile/80224
/* Convert -A / -B to A / B when the type is signed and overflow is
undefined. */
if ((!INTEGRAL_TYPE_P (type) || TYPE_OVERFLOW_UNDEFINED (type))
- && TREE_CODE (arg0) == NEGATE_EXPR
+ && TREE_CODE (op0) == NEGATE_EXPR
&& negate_expr_p (op1))
{
if (INTEGRAL_TYPE_P (type))
+2017-04-10 Richard Biener <rguenther@suse.de>
+
+ PR middle-end/80362
+ * gcc.dg/torture/pr80362.c: New testcase.
+
2017-04-10 Richard Biener <rguenther@suse.de>
PR tree-optimization/80304
--- /dev/null
+/* { dg-do run } */
+/* { dg-additional-options "-fstrict-overflow" } */
+
+int main()
+{
+ signed char var_0, var_1 = -128;
+ var_0 = (signed char)(-var_1) / 3;
+ if (var_0 > 0)
+ __builtin_abort();
+}