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]

Re: PATCH: Fix 20000724-1.c


Linus Torvalds <torvalds@transmeta.com> writes:

> Would it be horrible to implement asm's internally as control transfer
> instructions to a "magic subroutine"?

asms are not quite like subroutine calls.  For instance, in this routine:

int something(void)
{
  int result;
  result = get_something ();
  /* something here (perhaps just a complicated expression that runs
     the machine out of registers) that forces 'result' into memory */
  asm ("whatever" : : : "memory");
  return result;
}

If 'result' is in memory, then it needs to be re-loaded after the
'asm' statement; but if the 'asm' was a call, then 'result' could
be loaded before the call if that looked like a good idea.

-- 
- Geoffrey Keating <geoffk@geoffk.org>


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