]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
emit-rtl.c (gen_rtx_REG): Check that the PIC_OFFSET_TABLE_REGNUM is a fixed register...
authorJohn David Anglin <dave@hiauly1.hia.nrc.ca>
Tue, 29 Jan 2002 00:45:55 +0000 (00:45 +0000)
committerJohn David Anglin <danglin@gcc.gnu.org>
Tue, 29 Jan 2002 00:45:55 +0000 (00:45 +0000)
* emit-rtl.c (gen_rtx_REG): Check that the PIC_OFFSET_TABLE_REGNUM
is a fixed register before returning pic_offset_table_rtx.
* loop.c (scan_loop): Don't hoist insns that set pic_offset_table_rtx
when PIC_OFFSET_TABLE_REG_CALL_CLOBBERED is defined.

From-SVN: r49304

gcc/ChangeLog
gcc/emit-rtl.c
gcc/loop.c

index e1830f0b974359c646bbb122494ce5564943ab79..617f635dee065f648af11aa2eee05b181a18e256 100644 (file)
@@ -1,3 +1,10 @@
+2002-01-28  John David Anglin  <dave@hiauly1.hia.nrc.ca>
+
+       * emit-rtl.c (gen_rtx_REG): Check that the PIC_OFFSET_TABLE_REGNUM
+       is a fixed register before returning pic_offset_table_rtx.
+       * loop.c (scan_loop): Don't hoist insns that set pic_offset_table_rtx
+       when PIC_OFFSET_TABLE_REG_CALL_CLOBBERED is defined.
+
 2002-01-28  Jason Merrill  <jason@redhat.com>
 
        * dwarf2.h (enum dwarf_call_frame_info): Add other DWARF 3 codes.
index 2f3e100c8db2e28b2962b80afe2ec72a0d268711..0506a496d47ddb257cc80b3a23a7d7b23061c0c5 100644 (file)
@@ -411,7 +411,8 @@ gen_rtx_REG (mode, regno)
       if (regno == RETURN_ADDRESS_POINTER_REGNUM)
        return return_address_pointer_rtx;
 #endif
-      if (regno == PIC_OFFSET_TABLE_REGNUM)
+      if (regno == PIC_OFFSET_TABLE_REGNUM
+         && fixed_regs[PIC_OFFSET_TABLE_REGNUM])
         return pic_offset_table_rtx;
       if (regno == STACK_POINTER_REGNUM)
        return stack_pointer_rtx;
index ebd59af59ff2d59e67d53ee8a46b60ff6bab3aca..5df086689776f577d993fa3ddcd7a1490944f0c4 100644 (file)
@@ -762,6 +762,9 @@ scan_loop (loop, flags)
       if (GET_CODE (p) == INSN
          && (set = single_set (p))
          && GET_CODE (SET_DEST (set)) == REG
+#ifdef PIC_OFFSET_TABLE_REG_CALL_CLOBBERED
+         && SET_DEST (set) != pic_offset_table_rtx
+#endif
          && ! regs->array[REGNO (SET_DEST (set))].may_not_optimize)
        {
          int tem1 = 0;