Bug 59400 - [SH] gcc.c-torture/compile/pr55921.c fails with -O0 on big endian with FPU
Summary: [SH] gcc.c-torture/compile/pr55921.c fails with -O0 on big endian with FPU
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: target (show other bugs)
Version: 4.9.0
: P3 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on: 55212
Blocks:
  Show dependency treegraph
 
Reported: 2013-12-05 20:08 UTC by Oleg Endo
Modified: 2016-05-06 06:52 UTC (History)
0 users

See Also:
Host:
Target: sh*-*-*
Build:
Known to work:
Known to fail:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Oleg Endo 2013-12-05 20:08:36 UTC
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
Comment 1 Oleg Endo 2014-09-12 17:36:21 UTC
I've tried the problematic case with the sh-lra branch and the problem seems to be gone.
Comment 2 Oleg Endo 2016-05-06 06:52:59 UTC
It seems the problem disappeared somewhere between r210624 and r216017 even without LRA.