re PR middle-end/24750 (global-alloc (reload) trips over own confusion for unexpected addressing modes)

PR middle-end/24750
	* gcc.dg/torture/pr24750-1.c, gcc.target/cris/torture/pr24750-2.c:
        New tests.

From-SVN: r106806
This commit is contained in:
Hans-Peter Nilsson 2005-11-11 23:19:26 +00:00 committed by Hans-Peter Nilsson
parent 19fe122f94
commit 44087d555c
3 changed files with 98 additions and 0 deletions

View File

@ -1,3 +1,9 @@
2005-11-12 Hans-Peter Nilsson <hp@axis.com>
PR middle-end/24750
* gcc.dg/torture/pr24750-1.c, gcc.target/cris/torture/pr24750-2.c:
New tests.
2005-11-11 Andreas Tobler <a.tobler@schweiz.ch>
* lib/target-libpath.exp (get_shlib_extension): New proc.

View File

@ -0,0 +1,72 @@
extern int unknown;
extern int n0;
extern short *s0;
extern int n1;
extern short *s1;
extern short *s2;
extern int *n2;
extern int *n3;
extern int n4;
extern short *n5;
extern int *n6;
extern int n7;
extern char *unc;
void
f (short *sp)
{
int j = 0;
int i = 0;
int n8 = 0;
int n9 = 0;
short *s3 = sp;
short s4 = (short) unknown;
short s5 = (short) unknown;
char *c0 = unc;
int n10 = 0;
int n11 = 0;
int u0 = unknown;
int k = 0;
for (n8 = 1; n8 <= n7; n8++)
{
for (i = 1; i <= n0; i++)
c0[i] = 0;
for (i = 1; i <= u0; i++) { }
for (i = sp[0]; i != -32767; i = sp[i])
if (s4 == u0)
for (j = 1; j <= u0; j++)
if (!c0[s3[j]])
break;
}
for (n9 = 1; n9 <= n0; n9++) s1[unknown + n9] = n9;
for (i = 1; i <= n1; i++)
for (j = 1; j <= s4; j++)
s3[j] = s1[s3[j]];
for (n8 = 1; n8 <= n7; n8++)
for (i = 1; i <= s5; i++)
s3[i] = s1[s3[i]];
for (n9 = 1; n9 <= n0; n9++) sp[s1[n9]] = unknown;
for (n10 = 2; n10 < n4; n10++) { }
for (k = 1; k <= unknown; k++)
{
s4 = s0[n5[u0]];
for (i = 1; i <= s4; i++) { }
for (j = 1; j <= s4; j++)
if (n2[1] != 0)
if (i == unknown)
unknown = n3[unknown];
n6[u0] = n10;
}
for (k = n7; k >= n11; k--)
if (n2[k] == -32767)
break;
free (c0);
for (i = 1; i <= n7; i++)
{
for (j = 1; j <= s4; j++) { }
for (n8 = s2[unknown]; n8 != -32767; n8 = s2[n8]) { }
for (j = 1; j <= s5; j++) { }
}
}

View File

@ -0,0 +1,20 @@
/* As the invalid insn in this test got as far as to the target output
code and was "near enough" to output invalid assembly-code, we need
to pass it through the assembler as well.
{ dg-do assemble } */
int
f (short *a, char *y)
{
__asm__ ("" : : :
#ifndef __PIC__
"r0",
#endif
"r1", "r2", "r3", "r4", "r5", "r6", "r7",
/* Register R8 is frame-pointer, and we don't have a means
to not clobber it for the test-runs that don't eliminate
it. But that's ok; we have enough general-register
pressure to repeat the bug without that. */
"r9", "r10", "r11", "r12", "r13");
return y[*a];
}