This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Your change to jump_optimize and bug on PPro.


Hi,

I think I know why your change to jump_optimize breaks PPro. Your
new code will use conditional move on

const char *xdigs = (exp) ? "0123456789ABCDEF0X" : "0123456789abcdef0x";

Everything is fine until you have PIC on PPro. We get

(plus:SI (reg:SI 3 %ebx)
    (symbol_ref/v:SI ("*.LC0")))

as source in emit_conditional_move, which calls copy_to_mode_reg ()
to put it in REG. copy_to_mode_reg () calls force_operand (). But
force_operand () sees ebx + "*.LC0" and doesn't check if it is PIC.
It treats ebx as a normal register and converts ebx + "*.LC0" into
ebx + PIC ("*.LC0"), that is ebx + ebx + "*.LC0". Do you have a fix
for that? I was thinking to check PIC_OFFSET_TABLE_REGNUM and flag_pic
in force_operand. But I don't know if it is a right approach.

Thanks.

H.J.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]