This is the mail archive of the gcc-bugs@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]

c/1995: position dependency in asm("" : ... : : )



>Number:         1995
>Category:       c
>Synopsis:       position dependency in asm("" : ...  : : )
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Thu Feb 15 02:16:01 PST 2001
>Closed-Date:
>Last-Modified:
>Originator:     Etienne LORRAIN
>Release:        unknown-1.0
>Organization:
>Environment:
gcc version 2.97 20010212 on i386/Linux (www.codesourcery.com) for "inconsistent operand constraints in an `asm'"
Seen with error "asm too many reload" on gcc-2.95-2
>Description:
Compile with or without -DASM_TOO_MANY_RELOAD, _and_ with
at least -O for inlines, this code (the only difference is that the "+r" parameter is the last output or not):

extern unsigned dummy;
unsigned dummyfct (unsigned);
extern inline unsigned xchgl (unsigned adr, unsigned value)
  {
  unsigned short scratch;

#ifdef ASM_TOO_MANY_RELOAD
  asm volatile ("
        pushl   %2
        popw    %w0
        popw    %%fs
        xchgl   %%fs:(%w0),%1
        "
        : "=bSDB" (scratch), "+r" (value) : "g" (adr) : "memory");
#else
  asm volatile ("
        pushl   %2
        popw    %w1
        popw    %%fs
        xchgl   %%fs:(%w1),%0
        "
        : "+r" (value), "=bSDB" (scratch) : "g" (adr) : "memory");
#endif
  return value;
  }

unsigned fct (unsigned irq, unsigned fct_faradr)
  {
  if (dummy)
      return dummyfct (irq);
    else
      return xchgl (4*irq, fct_faradr);
  }
>How-To-Repeat:
http://www.codesourcery.com/cgi-bin/gcc-compile.py
See compiler messages, with:
"-O -DASM_TOO_MANY_RELOAD" or "-O"
>Fix:

>Release-Note:
>Audit-Trail:
>Unformatted:


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