This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: IA64 HP-UX ILP32 mode patch
- To: geoffk at geoffk dot org, jsm28 at cam dot ac dot uk, rth at redhat dot com
- Subject: Re: IA64 HP-UX ILP32 mode patch
- From: Steve Ellcey <sje at cup dot hp dot com>
- Date: Tue, 17 Jul 2001 14:21:07 -0700 (PDT)
- Cc: gcc-patches at gcc dot gnu dot org
- Reply-To: sje at cup dot hp dot com
Thanks for the feedback, I'll work on modifying the patch to see if I
can make it better. Addressing some of the points:
> You don't seem to actually define MD_CONVERT_MEMORY_ADDRESS anywhere.
>
> - Geoffrey Keating <geoffk@geoffk.org>
> But you didn't document it. Patches need documentation. Is this called
> somewhere performance-sensitive, or should you be using the target
> structure instead?
>
> Joseph S. Myers
Both of these are right, I forgot the documentation and the definition
got lost from the patch, though both of these may be moot if I modify
convert_memory_address based on POINTERS_EXTEND_UNSIGNED being less then
zero instead of having a hook.
Moving on to Richards comments:
> FWIW, I'd rather this be called ptr_extend, to match
> sign_extend and zero_extend.
This is easy to do, I will make the change.
> Use gr_register_operand, not register_operand.
I fixed ptr_extend and added the new instructions as well but the new
instructions caused a couple of new optimization failures that I don't
yet understand. I need to figure out what is happening with this and
fix it.
> I see two changes in your version. One, you check cfun nonnull,
> which seems pointless to me -- why wouldn't we have run into this
> on other targets? Two, you remove support for CONST, PLUS, and MULT.
> What examples lead you to this? If it's really unavoidable, perhaps
> you should simply add POINTERS_EXTEND_UNSIGNED >= 0 to this cases.
If I build gcc with the standard convert_memory_address and compile the
following program:
foo() { char * s = "hi"; }
I get:
(insn 9 17 10 (set (reg/f:SI 340)
(symbol_ref/f:SI ("*.LC0"))) -1 (nil)
(expr_list:REG_EQUAL (symbol_ref/f:SI ("*.LC0"))
(nil)))
bug1.c:1: Internal compiler error in extract_insn, at recog.c:2210
My thought was that I didn't want symbol_ref's to be in mode SI because
I always need to use a DI mode to access a symbol. It looks like I
originally just took out the SYMBOL_REF and LABEL_REF cases completely
but I think I had to put them back in to deal with some global
initialization cases. I just tried it again and with the SYMBOL_REF and
LABEL_REF cases completely gone I was able to compile and run the test
suite with no problems. With the standard SYMBOL_REF and LABEL_REF
cases I get the error shown above.
Its possible I could just say:
if (POINTERS_EXTEND_UNSIGNED < 0)
return convert_modes (to_mode, from_mode, x,
POINTERS_EXTEND_UNSIGNED);
before the case statement. I will experiment with this some more
and submit a new patch.
Steve Ellcey
sje@cup.hp.com