This is the mail archive of the gcc@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: extended asm (Was: Re: decl_conflicts_with_clobbers_p problem)


> Date: Mon, 17 Mar 2003 14:17:57 +0100
> From: Gunther Nikl <gni at gecko dot de>

> On Fri, Mar 14, 2003 at 05:32:56PM +0100, Hans-Peter Nilsson wrote:

> > No, that's not wrong.  But IIRC you wanted to specify the inputs
> > as (only) *outputs* in the code you sent as a follow-up, and
> > *that* was wrong.
> 
>   Now, that confuses me again. Here is the follow-up again:

> #define LP1NR(offs, name, t1, v1, r1, bt, bn)			\
...

At a cursory reading, that seems like it would work, yes.

> > >   Nethertheless, I would really really like to know, why overlaps of
> > >   clobbers with inputs isn't allowed. Yes, its documented but without
> > >   any explanation.
> > 
> > Isn't it enough that it simplifes the rules?  What if it was
> > allowed?  That'd introduce ambiguities and inconsistency with
> > the corresponding single-register-class-constraint construct.  I
> > wrote about that in enough detail in the URL I sent.
> 
>   Having pondered about the input/clobber constraint I think its not allowed
>   because GCC might be instructed to _choose_ the input register(s), right?
>   Since I am not an expert with GCC, the following is purely theoretical
>   and based upon the previous assumption: If GCC shall choose input (and
>   output) register(s) then the asm statement would contain placeholders
>   like %0, etc. Would it be viable to allow overlaps for clobbers with
>   inputs if the asm statement doesn't have any placeholder?

I don't understand what you mean by placeholders.

I insist that the current behavior is best; that it is an error
for an overlap of an asm clobber list with an asm-declared
register operand to the asm.  If there are no asm-declared
register declared operands to the asm, then GCC will not use
registers mentioned in the clobber list for the asm operands.
So, what should happen when you force an input (or output) to be
an asm-declared register mentioned in the clobber list?  If not
have it an error, what should GCC do?  Override the
asm-declaration or the clobber or try to merge them?  If a merge
is possible, how can we make sure the overlap was really
intentional?  When should GCC warn?

> > If you're not happy with the asm semantics, the burden falls on
> > you to provide argumentation and documentation for what should
> > happen instead, together with test-cases and patches to
> > implement that.
> 
>   I understand that and I admit that my understandig of extended asm was
>   flawed. Isn't that list intended to discuss such issues and to resolve
>   them?

Sure, but it really did sound like you want a change in
behavior, and *that* burden falls on the one who wants the
change.

brgds, H-P


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