public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug target/67260] New: [sh] Register spill bug for sibcall+complex+softfloat
@ 2015-08-18 16:38 bugdal at aerifal dot cx
  0 siblings, 0 replies; only message in thread
From: bugdal at aerifal dot cx @ 2015-08-18 16:38 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67260

            Bug ID: 67260
           Summary: [sh] Register spill bug for sibcall+complex+softfloat
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: target
          Assignee: unassigned at gcc dot gnu.org
          Reporter: bugdal at aerifal dot cx
  Target Milestone: ---

Created attachment 36205
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=36205&action=edit
Preprocessed C source file demonstrating the bug

cacoshl() from musl's complex math library produces an error with all versions
of GCC tested, up through 5.2.0, when sibcall optimization is enabled:

src/complex/cacoshl.c: In function 'cacoshl':
src/complex/cacoshl.c:7:1: error: unable to find a register to spill in class
'SIBCALL_REGS'

 }
 ^
src/complex/cacoshl.c:7:1: error: this is the insn:
(call_insn/j 12 11 13 2 (parallel [
            (set (reg:DC 0 r0)
                (call (mem:SI (symbol_ref:SI ("cacosh") [flags 0x43]
<function_decl 0x7f754b09aca8 cacosh>) [0 cacosh S4 A32])
                    (const_int 0 [0])))
            (use (reg:SI 154 fpscr0))
            (clobber (scratch:SI))
            (return)
        ]) src/complex/cacoshl.c:6 335 {sibcall_value_pcrel}
     (expr_list:REG_DEAD (reg:SI 154 fpscr0)
        (expr_list:REG_DEAD (reg:DC 4 r4)
            (expr_list:REG_CALL_DECL (symbol_ref:SI ("cacosh") [flags 0x43]
<function_decl 0x7f754b09aca8 cacosh>)
                (nil))))
    (expr_list:DC (use (reg:DC 4 r4))
        (nil)))
src/complex/cacoshl.c:7: confused by earlier errors, bailing out


Using -fno-optimize-sibling-calls makes the error go away. The error also does
not occur on sh4 (in the default configuration), which has fpu, only on sh2
with soft-float.

I'm attaching the preprocessed output of cacoshl.c that can be used to
reproduce the error. I don't have a simpler testcase at the moment.


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2015-08-18 16:38 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-08-18 16:38 [Bug target/67260] New: [sh] Register spill bug for sibcall+complex+softfloat bugdal at aerifal dot cx

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).