This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Your change to jump_optimize and bug on PPro.
- To: rth at cygnus dot com
- Subject: Your change to jump_optimize and bug on PPro.
- From: hjl at lucon dot org (H.J. Lu)
- Date: Thu, 4 Jun 1998 10:52:31 -0700 (PDT)
- Cc: egcs-bugs at cygnus dot com
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.