public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "jfc at mit dot edu" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug middle-end/36791]  New: ICE with constant argument to __builtin_eh_return
Date: Thu, 10 Jul 2008 14:44:00 -0000	[thread overview]
Message-ID: <bug-36791-6365@http.gcc.gnu.org/bugzilla/> (raw)

This function causes an ICE in rtl generation:

void g()
{
  __builtin_eh_return(0, 0);
}

The crash happens when either operand to __builtin_eh_return is an integer
constant.  expand_builtin_eh_return calls copy_to_reg on a CONST_INT operand. 
copy_to_reg generates a register with mode VOIDmode.

I think the fix is to change the two calls to copy_to_reg to copy_addr_to_reg
in expand_builtin_eh_return.

This bug seems to be present for many versions and on at least two targets, x86
and SPARC.

Note that with optimization on the same crash may occur if a variable known to
hold an integer constant value is passed as the first argument.


-- 
           Summary: ICE with constant argument to __builtin_eh_return
           Product: gcc
           Version: 4.3.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: middle-end
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: jfc at mit dot edu
  GCC host triplet: x86_64-linux-gnu


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36791


             reply	other threads:[~2008-07-10 14:44 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-07-10 14:44 jfc at mit dot edu [this message]
2008-07-10 15:22 ` [Bug middle-end/36791] " jfc at mit dot edu
2008-12-27 22:08 ` pinskia at gcc dot gnu dot 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-36791-6365@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).