http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59400

            Bug ID: 59400
           Summary: [SH] gcc.c-torture/compile/pr55921.c fails with -O0 on
                    big endian with FPU
           Product: gcc
           Version: 4.9.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: target
          Assignee: unassigned at gcc dot gnu.org
          Reporter: olegendo at gcc dot gnu.org
            Target: sh*-*-*

The test case gcc.c-torture/compile/pr55921.c has been failing for a while on
big endian targets with an FPU (e.g. SH4) when compiled with -O0.
Little endian seems OK.

typedef union
{
  _Complex float cf;
  long long ll;
} ucf;

void
foo (ucf *in, ucf *out, _Complex float r)
{
  int i;
  ucf ucf1;
  _Complex float cf;

  ucf1.ll = in[i].ll;
  __asm ("" : "=r" (cf) : "r" (ucf1.ll));
  cf *= r;
  __asm ("" : "=r" (ucf1.ll) : "r" (cf));
  out[i].ll = ucf1.ll;
}

compiled with -O0 -m4 -mb:

sh_tmp.cpp: In function 'foo':
sh_tmp.cpp:641:3: error: 'asm' operand requires impossible reload
   __asm ("" : "=r" (cf) : "r" (ucf1.ll));
   ^
sh_tmp.cpp:641:3: error: 'asm' operand requires impossible reload
sh_tmp.cpp:643:3: error: 'asm' operand requires impossible reload
   __asm ("" : "=r" (ucf1.ll) : "r" (cf));
   ^
sh_tmp.cpp:643:3: error: 'asm' operand requires impossible reload

Reply via email to