aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJim Wilson <wilson@cygnus.com>1997-08-28 20:04:19 +0000
committerJim Wilson <wilson@gcc.gnu.org>1997-08-28 13:04:19 -0700
commit00fc09e1496ef843e27f98c53f19cb6141993526 (patch)
tree66dc80f24ea66452119a42a584107a662c0b3e2b
parent2601ebca412b05d466bccccd2c4a74e1cec60c05 (diff)
downloadgcc-00fc09e1496ef843e27f98c53f19cb6141993526.zip
gcc-00fc09e1496ef843e27f98c53f19cb6141993526.tar.gz
gcc-00fc09e1496ef843e27f98c53f19cb6141993526.tar.bz2
Fix x86 libio -O2 miscompilation problem.
* i386.c (ix86_expand_epilogue): Emit blockage instruction when pic. From-SVN: r14992
-rw-r--r--gcc/ChangeLog4
-rw-r--r--gcc/config/i386/i386.c10
2 files changed, 14 insertions, 0 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index d135b4b..33fec6b 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,7 @@
+Thu Aug 28 13:01:43 1997 Jim Wilson <wilson@cygnus.com>
+
+ * i386.c (ix86_expand_epilogue): Emit blockage instruction when pic.
+
Thu Aug 28 07:03:15 1997 Jeffrey A Law (law@cygnus.com)
* version.c: Bump for latest snapshot.
diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c
index 35dbc62..d8d9757 100644
--- a/gcc/config/i386/i386.c
+++ b/gcc/config/i386/i386.c
@@ -2128,6 +2128,16 @@ ix86_expand_epilogue ()
xops[2] = stack_pointer_rtx;
+ /* When -fpic, we must emit a scheduling barrier, so that the instruction
+ that restores %ebx (which is PIC_OFFSET_TABLE_REGNUM), does not get
+ moved before any instruction which implicitly uses the got. This
+ includes any instruction which uses a SYMBOL_REF or a LABEL_REF.
+
+ Alternatively, this could be fixed by making the dependence on the
+ PIC_OFFSET_TABLE_REGNUM explicit in the RTL. */
+ if (flag_pic)
+ emit_insn (gen_blockage ());
+
if (nregs > 1 || ! frame_pointer_needed)
{
if (frame_pointer_needed)