Bug 52504 - (unreachable) out of bounds access in thread_prologue_and_epilogue_insns
(unreachable) out of bounds access in thread_prologue_and_epilogue_insns
Status: UNCONFIRMED
Product: gcc
Classification: Unclassified
Component: middle-end
4.8.0
: P3 normal
: ---
Assigned To: Not yet assigned to anyone
:
Depends on:
Blocks: 44756 56456
  Show dependency treegraph
 
Reported: 2012-03-06 00:40 UTC by Jorn Wolfgang Rennecke
Modified: 2013-02-26 09:57 UTC (History)
0 users

See Also:
Host: x86_64-unknown-linux-gnu, i686-pc-linux-gnu
Target: rx-elf
Build:
Known to work:
Known to fail:
Last reconfirmed: 2013-02-25 00:00:00


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jorn Wolfgang Rennecke 2012-03-06 00:40:25 UTC
gcc -c   -g -O2 -DIN_GCC -DCROSS_DIRECTORY_STRUCTURE  -W -Wall -Wno-narrowing -Wwrite-strings -Wcast-qual -Wstrict-prototypes -Wmissing-prototypes -Wmissing-format-attribute -pedantic -Wno-long-long -Wno-variadic-macros -Wno-overlength-strings -Werror -Wold-style-definition -Wc++-compat -fno-common  -DHAVE_CONFIG_H -I. -I. -I../../../gcc/gcc -I../../../gcc/gcc/. -I../../../gcc/gcc/../include -I../../../gcc/gcc/../libcpp/include -I/opt/cfarm/mpc/include  -I../../../gcc/gcc/../libdecnumber -I../../../gcc/gcc/../libdecnumber/dpd -I../libdecnumber    ../../../gcc/gcc/function.c -o function.o
In file included from ../../../gcc/gcc/function.c:48:0:
../../../gcc/gcc/function.c: In function ‘thread_prologue_and_epilogue_insns’:
../../../gcc/gcc/regs.h:322:34: error: array subscript is above array bounds [-Werror=array-bounds]
cc1: all warnings being treated as errors
make[2]: *** [function.o] Error 1

I see that thread_prologue_and_epilogue_insns has:
      if (pic_offset_table_rtx)
        add_to_hard_reg_set (&set_up_by_prologue.set, Pmode,
                             PIC_OFFSET_TABLE_REGNUM);
Where PIC_OFFSET_TABLE_REGNUM is INVALID_REGNUM, this becomes an out-of-bounds
array access.