From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 20365 invoked by alias); 17 Feb 2013 10:11:55 -0000 Received: (qmail 20216 invoked by uid 48); 17 Feb 2013 10:11:41 -0000 From: "jay.krell at cornell dot edu" To: gcc-bugs@gcc.gnu.org Subject: [Bug target/56361] New: assertion failure passing structs w/o fields by value on sparc64 Date: Sun, 17 Feb 2013 10:11: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-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: jay.krell at cornell dot edu X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Changed-Fields: Message-ID: X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated Content-Type: text/plain; charset="UTF-8" MIME-Version: 1.0 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 X-SW-Source: 2013-02/txt/msg01723.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56361 Bug #: 56361 Summary: assertion failure passing structs w/o fields by value on sparc64 Classification: Unclassified Product: gcc Version: 4.7.2 Status: UNCONFIRMED Severity: normal Priority: P3 Component: target AssignedTo: unassigned@gcc.gnu.org ReportedBy: jay.krell@cornell.edu We have a strange front end. It declares structs with size but no fields. It actually works..except sometimes for SPARC64. We have a function that passes a few structs by value. They are 12 bytes each. 4.7.2/config/sparc/sparc.c: static rtx function_arg_record_value (const_tree type, enum machine_mode mode, int slotno, int named, int regbase) . . . else { /* ??? C++ has structures with no fields, and yet a size. Give up for now and pass everything back in integer registers. */ nregs = (typesize + UNITS_PER_WORD - 1) / UNITS_PER_WORD; } if (nregs + slotno > SPARC_INT_ARG_MAX) nregs = SPARC_INT_ARG_MAX - slotno; } gcc_assert (nregs != 0); SPARC_INT_ARG_MAX == 6 nregs = 2 slotno = 6 so then nregs = 0 and the assert fails I think it should say: gcc_assert (nregs != 0 || parms.stack);