re PR target/8340 (ICE on x86 inline asm w/ -fPIC)
PR target/8340 * stmt.c (expand_asm_operands): Produce an error when the PIC register is clobbered. From-SVN: r60313
This commit is contained in:
parent
7f22efe1d6
commit
e54b4cae03
4 changed files with 38 additions and 1 deletions
|
@ -1,3 +1,9 @@
|
|||
2002-12-19 Eric Botcazou <ebotcazou@libertysurf.fr>
|
||||
|
||||
PR target/8340
|
||||
* stmt.c (expand_asm_operands): Produce an error when
|
||||
the PIC register is clobbered.
|
||||
|
||||
2002-12-18 Daniel Berlin <dberlin@dberlin.org>
|
||||
|
||||
* Makefile.in (OBJS): Add alloc-pool.o
|
||||
|
|
11
gcc/stmt.c
11
gcc/stmt.c
|
@ -1509,7 +1509,16 @@ expand_asm_operands (string, outputs, inputs, clobbers, vol, filename, line)
|
|||
|
||||
/* Mark clobbered registers. */
|
||||
if (i >= 0)
|
||||
SET_HARD_REG_BIT (clobbered_regs, i);
|
||||
{
|
||||
/* Clobbering the PIC register is an error */
|
||||
if ((unsigned) i == PIC_OFFSET_TABLE_REGNUM)
|
||||
{
|
||||
error ("PIC register `%s' clobbered in `asm'", regname);
|
||||
return;
|
||||
}
|
||||
|
||||
SET_HARD_REG_BIT (clobbered_regs, i);
|
||||
}
|
||||
}
|
||||
|
||||
clear_last_expr ();
|
||||
|
|
|
@ -1,3 +1,7 @@
|
|||
2002-12-19 Eric Botcazou <ebotcazou@libertysurf.fr>
|
||||
|
||||
* gcc.dg/i386-pic-1.c: New test.
|
||||
|
||||
2002-12-18 Kriang Lerdsuwanakij <lerdsuwa@users.sourceforge.net>
|
||||
|
||||
PR c++/8099
|
||||
|
|
18
gcc/testsuite/gcc.dg/i386-pic-1.c
Normal file
18
gcc/testsuite/gcc.dg/i386-pic-1.c
Normal file
|
@ -0,0 +1,18 @@
|
|||
/* PR target/8340 */
|
||||
/* { dg-do compile { target i?86-*-* } } */
|
||||
/* { dg-options "-fPIC" } */
|
||||
|
||||
int foo ()
|
||||
{
|
||||
static int a;
|
||||
|
||||
__asm__ __volatile__ ( /* { dg-error "PIC register" } */
|
||||
"xorl %%ebx, %%ebx\n"
|
||||
"movl %%ebx, %0\n"
|
||||
: "=m" (a)
|
||||
:
|
||||
: "%ebx"
|
||||
);
|
||||
|
||||
return a;
|
||||
}
|
Loading…
Add table
Reference in a new issue