public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "jay.krell at cornell dot edu" <gcc-bugzilla@gcc.gnu.org>
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	[thread overview]
Message-ID: <bug-56361-4@http.gcc.gnu.org/bugzilla/> (raw)


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);


             reply	other threads:[~2013-02-17 10:11 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-02-17 10:11 jay.krell at cornell dot edu [this message]
2013-02-20 18:57 ` [Bug target/56361] " ebotcazou at gcc dot gnu.org
2013-12-11 13:18 ` ebotcazou at gcc dot gnu.org

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-56361-4@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).