Commit fcf750ee by Adam Nemet Committed by Adam Nemet

re PR middle-end/18160 (ICE on taking register variable address)

	PR middle-end/18160
	* gcc.dg/register-var-1.c: New test.
	* gcc.dg/register-var-2.c: New test.
	* gcc.dg/asm-7.c: Taking the address of a register variable is an
	error now.

From-SVN: r89773
parent 0039fa55
2004-10-28 Adam Nemet <anemet@lnxw.com>
PR middle-end/18160
* gcc.dg/register-var-1.c: New test.
* gcc.dg/register-var-2.c: New test.
* gcc.dg/asm-7.c: Taking the address of a register variable is an
error now.
2004-10-28 Dorit Naishlos <dorit@il.ibm.com>
PR other/18172
......
......@@ -9,7 +9,7 @@ void test(void)
static int m;
int *p;
__asm__ ("" : : "m"(r)); /* { dg-warning "address of register" } */
__asm__ ("" : : "m"(r)); /* { dg-error "" } */
__asm__ ("" : : "m"(i));
__asm__ ("" : : "m"(m));
__asm__ ("" : : "m"(0)); /* { dg-error "" } */
......@@ -22,7 +22,7 @@ void test(void)
__asm__ ("" : : "g"(0));
__asm__ ("" : : "g"(i+1));
__asm__ ("" : "=m"(r2)); /* { dg-warning "address of register" } */
__asm__ ("" : "=m"(r2)); /* { dg-error "" } */
__asm__ ("" : "=m"(i));
__asm__ ("" : "=m"(m));
}
/* PR/18160 */
/* { dg-do compile { target i?86-*-* } } */
/* This should yield an error even without -pedantic. */
/* { dg-options "-ansi" } */
void g(int *);
void f(void)
{
register int x __asm ("eax");
g(&x); /* { dg-error "error: address of register variable" } */
}
/* PR/18160 */
/* { dg-do compile } */
/* This should yield an error even without -pedantic. */
/* { dg-options "-ansi" } */
void g(int *);
void f(void)
{
register int x;
g(&x); /* { dg-error "error: address of register variable" } */
}
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