PR middle-end/44765
authoramylaar <amylaar@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 4 Nov 2010 12:41:07 +0000 (12:41 +0000)
committeramylaar <amylaar@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 4 Nov 2010 12:41:07 +0000 (12:41 +0000)
* emit-rtl.c (gen_rtx_REG): Before using PIC_OFFSET_TABLE_REGNUM
as an index, check it is not INVALID_REGNUM.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@166307 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/emit-rtl.c

index 2cfb60a..213846d 100644 (file)
@@ -1,3 +1,9 @@
+2010-10-04  Joern Rennecke  <amylaar@spamcop.net>
+
+       PR middle-end/44765
+       * emit-rtl.c (gen_rtx_REG): Before using PIC_OFFSET_TABLE_REGNUM
+       as an index, check it is not INVALID_REGNUM.
+
 2010-11-04  Ira Rosen  <irar@il.ibm.com>
 
        PR tree-optimization/46213
index eb4ea2a..60fe39b 100644 (file)
@@ -603,6 +603,7 @@ gen_rtx_REG (enum machine_mode mode, unsigned int regno)
        return return_address_pointer_rtx;
 #endif
       if (regno == (unsigned) PIC_OFFSET_TABLE_REGNUM
+         && PIC_OFFSET_TABLE_REGNUM != INVALID_REGNUM
          && fixed_regs[PIC_OFFSET_TABLE_REGNUM])
        return pic_offset_table_rtx;
       if (regno == STACK_POINTER_REGNUM)