[PATCH] Fix compile time warning caused by PIC_OFFSET_TABLE_REGNUM

Jiong Wang jiong.wang@arm.com
Tue Sep 23 19:15:00 GMT 2014


PIC_OFFSET_TABLE_REGNUM is default to be INVALID_NUM, we need to make sure
it's not used as unsigned type register index, otherwise there will be array
index out of bound warning which will be treated as error.

the code in shrink-wrap.c is not guarded by this check which will cause trouble for
any target that define PIC_OFFSET_TABLE_REGNUM as INVALID_REGNUM, for example aarch64.

(sorry, my BOOT_CFLAGS was -O2 -w -fdump-rtl-pro_and_epilogue which hidden this issue...)

ok for trunk as obivious?

Thanks.

gcc/
   * shrink-wrap.c (try_shrink_wrapping): Check PIC_OFFSET_TABLE_REGNUM not be INVALID_REGNUM.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: fix-pic.patch
Type: text/x-patch
Size: 549 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20140923/f0e3eb8f/attachment.bin>


More information about the Gcc-patches mailing list