Commit bf9412cd by Joern Rennecke Committed by Joern Rennecke

re PR middle-end/44765 (gen_rtx_REG can make out-of-bounds access for INVALID_REGNUM)

	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.

From-SVN: r166307
parent 0532869d
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
......@@ -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)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment