Commit 100ed614 by Kazu Hirata Committed by Kazu Hirata

re PR target/51408 (Miscompilation in arm.md:*minmax_arithsi)

gcc/
	PR target/51408
	* config/arm/arm.md (*minmax_arithsi): Always require the else
	clause in the MINUS case.

gcc/testsuite/
	PR target/51408
	* gcc.dg/pr51408.c: New.

From-SVN: r182014
parent c4ce224c
2011-12-05 Kazu Hirata <kazu@codesourcery.com>
PR target/51408
* config/arm/arm.md (*minmax_arithsi): Always require the else
clause in the MINUS case.
2011-12-05 Richard Guenther <rguenther@suse.de>
PR tree-optimization/50904
......@@ -3413,7 +3413,7 @@
bool need_else;
if (which_alternative != 0 || operands[3] != const0_rtx
|| (code != PLUS && code != MINUS && code != IOR && code != XOR))
|| (code != PLUS && code != IOR && code != XOR))
need_else = true;
else
need_else = false;
......
2011-12-05 Kazu Hirata <kazu@codesourcery.com>
PR target/51408
* gcc.dg/pr51408.c: New.
2011-12-05 Jason Merrill <jason@redhat.com>
* g++.dg/cpp0x/dc6.C: New.
......
/* This testcase used to fail because of a bug in
arm.md:*minmax_arithsi. */
/* { dg-do run } */
/* { dg-options "-O1" } */
extern void abort (void);
int __attribute__((noinline))
foo (int a, int b)
{
int max = (b > 0) ? b : 0;
return max - a;
}
int
main (void)
{
if (foo (3, -1) != -3)
abort ();
return 0;
}
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