diff mbox

Committed: Fix middle-end/44765

Message ID 20101104084743.u7m15lwiv48c8o0c-nzlynne@webmail.spamcop.net
State New
Headers show

Commit Message

Joern Rennecke Nov. 4, 2010, 12:47 p.m. UTC
This fixes the warning about the out-of-range-access when
PIC_OFFSET_TABLE_REGNUM has the default value of INVALID_REGNUM,
like for mep-elf.

Bootstrapped on i686-pc-linux-gnu.
Committed as obvious.
2010-11-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.
diff mbox

Patch

Index: emit-rtl.c
===================================================================
--- emit-rtl.c	(revision 166238)
+++ emit-rtl.c	(working copy)
@@ -603,6 +603,7 @@  gen_rtx_REG (enum machine_mode mode, uns
 	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)