From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 78669 invoked by alias); 18 Aug 2015 16:38:32 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org Received: (qmail 73822 invoked by uid 48); 18 Aug 2015 16:38:28 -0000 From: "bugdal at aerifal dot cx" To: gcc-bugs@gcc.gnu.org Subject: [Bug target/67260] New: [sh] Register spill bug for sibcall+complex+softfloat Date: Tue, 18 Aug 2015 16:38:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: target X-Bugzilla-Version: unknown X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: bugdal at aerifal dot cx X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter target_milestone attachments.created Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-SW-Source: 2015-08/txt/msg01252.txt.bz2 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] ) [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] ) (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.