Commit 7d704548 by Jakub Jelinek Committed by Jakub Jelinek

re PR middle-end/77594 (double computation for __builtin_sub_overflow (0, ...))

	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.

	* gcc.target/i386/pr77594.c: New test.

Co-Authored-By: Eric Botcazou <ebotcazou@adacore.com>

From-SVN: r240173
parent ff18118f
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
......
......@@ -1833,7 +1833,10 @@ expand_arith_overflow (enum tree_code code, gimple *stmt)
{
case MINUS_EXPR:
if (integer_zerop (arg0) && !unsr_p)
{
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
......
/* 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 } } */
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment