PR target/8340
* stmt.c (expand_asm_operands): Produce an error when
the PIC register is clobbered.
From-SVN: r60313
+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
/* 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 ();
+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
--- /dev/null
+/* 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;
+}