Hi,
I noticed that pic_offset_table_rtx is initialized twice in GCC. Take
x86_32 as an example.
The first initialization is done in emit_init_regs, with below code:
pic_offset_table_rtx = NULL_RTX;
if ((unsigned) PIC_OFFSET_TABLE_REGNUM != INVALID_REGNUM)
pic_offset_table_rtx = gen_raw_REG (Pmode, PIC_OFFSET_TABLE_REGNUM);
On x86_32 with pic, we have:
(gdb) call debug_rtx(this_target_rtl->x_pic_offset_table_rtx)
(reg:SI 3 bx)
The second initialization is in expand_used_vars, with below code:
if (targetm.use_pseudo_pic_reg ())
pic_offset_table_rtx = gen_reg_rtx (Pmode);
On x86_32 with pic, we have:
(gdb) call debug_rtx(this_target_rtl->x_pic_offset_table_rtx)
(reg:SI 87)
So basically after expanding the first function, pic_offset_table_rtx
is set to a pseudo register, rather than the one initialized in
emit_init_regs.
Also this causes inconsistent compilation for the first/rest functions
in one compilation unit.
A bug?
Thanks,
bin