This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: Don't use auto inc/dec addresses in asm operands
- From: Richard Sandiford <rdsandiford at googlemail dot com>
- To: Richard Henderson <rth at redhat dot com>
- Cc: gcc-patches at gcc dot gnu dot org, richards at transitive dot com, edelsohn at gnu dot org
- Date: Sun, 12 Jul 2009 19:46:55 +0100
- Subject: Re: Don't use auto inc/dec addresses in asm operands
- References: <g4bpnsrep7.fsf@richards-desktop.transitives.com> <4A577476.30803@redhat.com>
Richard Henderson <rth@redhat.com> writes:
> On 07/10/2009 03:54 AM, Richard Sandiford wrote:
>> This patch fixes a case in which an AIX compiler would use a
>> PRE_INC address inside an asm "m" operand. We can't rely on
>> asm operands to do increments and decrements like this,
>> because the asm can legitimately write to the memory more
>> than once or (as here) not write to it at all.
>
> Not to say your patch shouldn't go in but FYI, there's an S constraint
> on ia64 that is used to prohibit autoinc addresses in asms. It may be
> that can be simplified or eliminated.
Ah, I hadn't realised that. It sounds from what you and Andreas say
that auto inc-dec in asms are actually OK, so I'll reeducate myself
and my colleague ;)
And I see that fpu_control.h does indeed use %U with "m", so my patch
would be an optimisation regression as far as that's concerned. Oh well.
David, is there already a similar asm constraint for power that I missed?
If not, do you think we should add one, and if so what should it be called?
Or do you think it's OK to tell people to use "o" instead, like Andreas says?
My concern was that reg+reg addresses aren't AIUI offsetable, so using "o"
might be unnecessarily restrictive.
Richard