Commit 17038fcf by Jakub Jelinek

re PR target/48774 (gcc-4.6.0 optimization regression on x86_64-unknown-linux-gnu)

	PR target/48774
	* config/i386/i386.c (ix86_match_ccmode): For CC{A,C,O,S}mode
	only succeed if req_mode is the same as set_mode.

	* gcc.dg/pr48774.c: New test.

From-SVN: r173301
parent 3810076b
2011-05-03 Uros Bizjak <ubizjak@gmail.com>
Jakub Jelinek <jakub@redhat.com>
PR target/48774
* config/i386/i386.c (ix86_match_ccmode): For CC{A,C,O,S}mode
only succeed if req_mode is the same as set_mode.
2011-05-03 Bernd Schmidt <bernds@codesourcery.com>
* gengenrtl.c (special_rtx): PC, CC0 and RETURN are special.
......
......@@ -17299,11 +17299,15 @@ ix86_match_ccmode (rtx insn, enum machine_mode req_mode)
if (req_mode == CCZmode)
return false;
/* FALLTHRU */
case CCZmode:
break;
case CCAmode:
case CCCmode:
case CCOmode:
case CCSmode:
case CCZmode:
if (set_mode != req_mode)
return false;
break;
default:
2011-05-03 Jakub Jelinek <jakub@redhat.com>
PR target/48774
* gcc.dg/pr48774.c: New test.
2011-05-03 Richard Guenther <rguenther@suse.de>
* gcc.dg/large-size-array-5.c: New testcase.
......
/* PR target/48774 */
/* { dg-do run } */
/* { dg-options "-O2 -funroll-loops" } */
extern void abort (void);
unsigned long int s[24]
= { 12, ~1, 12, ~2, 12, ~4, 12, ~8, 12, ~16, 12, ~32,
12, ~64, 12, ~128, 12, ~256, 12, ~512, 12, ~1024, 12, ~2048 };
struct { int n; unsigned long *e[12]; } g
= { 12, { &s[0], &s[2], &s[4], &s[6], &s[8], &s[10], &s[12], &s[14],
&s[16], &s[18], &s[20], &s[22] } };
int c[12];
__attribute__((noinline, noclone)) void
foo (void)
{
int i, j;
for (i = 0; i < g.n; i++)
for (j = 0; j < g.n; j++)
{
if (i == j && j < g.e[0][0] && (g.e[i][1] & (1UL << j)))
abort ();
if (j < g.e[0][0] && (g.e[i][1] & (1UL << j)))
c[i]++;
}
}
int
main ()
{
int i;
asm volatile ("" : "+m" (s), "+m" (g), "+m" (c));
foo ();
for (i = 0; i < 12; i++)
if (c[i] != 11)
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