+2016-09-16 Jakub Jelinek <jakub@redhat.com>
+ Eric Botcazou <ebotcazou@adacore.com>
+
+ PR middle-end/77594
+ * internal-fn.c (expand_arith_overflow) <case MINUS_EXPR>: Don't fall
+ through into expand_addsub_overflow after expand_neg_overflow.
+
2016-09-15 David Malcolm <dmalcolm@redhat.com>
* diagnostic-show-locus.c
{
case MINUS_EXPR:
if (integer_zerop (arg0) && !unsr_p)
- expand_neg_overflow (loc, lhs, arg1, false);
+ {
+ expand_neg_overflow (loc, lhs, arg1, false);
+ return;
+ }
/* FALLTHRU */
case PLUS_EXPR:
expand_addsub_overflow (loc, code, lhs, arg0, arg1,
+2016-09-16 Jakub Jelinek <jakub@redhat.com>
+ Eric Botcazou <ebotcazou@adacore.com>
+
+ PR middle-end/77594
+ * gcc.target/i386/pr77594.c: New test.
+
2016-09-15 Louis Krupp <louis.krupp@zoho.com>
PR fortran/69963
--- /dev/null
+/* PR middle-end/77594 */
+/* { dg-do compile } */
+/* { dg-options "-O0" } */
+
+int
+foo (int a, int *b)
+{
+ return __builtin_sub_overflow (0, a, b);
+}
+
+/* { dg-final { scan-assembler-times "\tjn?o\t" 1 } } */