This is the mail archive of the gcc-patches@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]
Other format: [Raw text]

Re: [PATCH]: Fix PR rtl-optimization/31344


On 07 May 2007 23:53:27 -0700, Ian Lance Taylor <iant@google.com> wrote:

>       PR rtl-optimization/31344
>         * explow.c (memory_address): Do not force autoincremented or
>       autodecremented address references into pseudo register.

This does not look right in the general case.  It seems that the
effect is going to be that if memory_address_p fails for an
autoincrement address, we still return it.  That seems wrong.
memory_address should always return a valid address.  I can see that
this will do what we want for the x86, but it doesn't look right for
other processors.

Perhaps the patch can be enhanced to check for (set (reg/f:SI 61) (pre_dec:SI (reg/f:SI 7 sp))) -1 (nil)

pattern in PRE_* and POST_* cases?

So, in above case, if the pre_dec insn is available, we emit the insn,
otherwise we return pre_dec reference in hope that it is OK. Please
note, that even in this case, memory was modified to something
"almost" acceptable via conver_memory_address(), but rejected from
memory_address_p().

Another possible solution would be to change i386's legitimate
address_p. pre_dec with SP reg is a legitimate address.

Uros.


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