Commit e54b4cae by Eric Botcazou Committed by Eric Botcazou

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
parent 7f22efe1
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> 2002-12-18 Daniel Berlin <dberlin@dberlin.org>
* Makefile.in (OBJS): Add alloc-pool.o * Makefile.in (OBJS): Add alloc-pool.o
......
...@@ -1509,7 +1509,16 @@ expand_asm_operands (string, outputs, inputs, clobbers, vol, filename, line) ...@@ -1509,7 +1509,16 @@ expand_asm_operands (string, outputs, inputs, clobbers, vol, filename, line)
/* Mark clobbered registers. */ /* Mark clobbered registers. */
if (i >= 0) 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 (); clear_last_expr ();
......
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> 2002-12-18 Kriang Lerdsuwanakij <lerdsuwa@users.sourceforge.net>
PR c++/8099 PR c++/8099
......
/* 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;
}
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