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]

asm changes? [Was: Re: flow.c bugfix ]



  In message <19981203173736.C12477@dot.cygnus.com>you write:
  > On Thu, Dec 03, 1998 at 03:47:48PM +0100, Franz Sirl wrote:
  > > static int foo;
  > > void bar (void) { asm ("" : "r"(&foo)); }
  > 
  > This is in error anyway.  You're missing a colon:
  > 
  >   void bar (void) { asm ("" : : "r"(&foo)); }
  > 
  > Otherwise you are treating that as an asm output, which is just
  > bound to get you into trouble.  I'm actually surprised that it
  > didn't get flagged as an error earlier.
Which reminds me -- this is how Linus would like us to fix the asm problem.
I haven't had a time to do any research on how feasible this would be, but
I'll go ahead and get the discussion started.

--

Basically they need a more intuitive way to say "this value must be in a 
register at the start of this asm and the register will be clobbered
unpredictably within the asm".

Let's face it, the matching constraint with an earlyclobber on the output
works, but unless you write gcc machine descriptions for a living it is
non-obvious.

I'm willing to look into changes to the syntax to help them, particularly
since it looks like Linus is ready to declare egcs as the Linux kernel's
compiler if we come up with something reasonable.

Linus likes the idea of an earlyclobber on the input operand.  It's marginally
gross, but may be reasonable.  Linus says it works with gcc-2.7 era compilers.
I find that suprising, but if it is true, it gives the Linux kernel folks a
better upgrade path than something completely new.

Another option would be to allow clobbers that overlap an input.  That would
standardize existing practice which may also be acceptable to Linus. 

I don't know how difficult either would be.  We could even consider pulling
up some old patches from last year which actually turned an overlapping
explicit clobber into a matching in/out with an earlyclobber since such
transformations should be safe now.


Let's at least get the ball rolling.  All suggestions to deal with this are
on the table.  No preconditions.



jeff




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