Bug 36791 - ICE with constant argument to __builtin_eh_return
Summary: ICE with constant argument to __builtin_eh_return
Status: NEW
Alias: None
Product: gcc
Classification: Unclassified
Component: middle-end (show other bugs)
Version: 4.3.1
: P3 minor
Target Milestone: ---
Assignee: Not yet assigned to anyone
Keywords: ice-on-valid-code
Depends on:
Reported: 2008-07-10 14:43 UTC by John F. Carr
Modified: 2008-12-27 22:04 UTC (History)
1 user (show)

See Also:
Known to work:
Known to fail:
Last reconfirmed: 2008-12-27 22:04:44


Note You need to log in before you can comment on or make changes to this bug.
Description John F. Carr 2008-07-10 14:43:24 UTC
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.
Comment 1 Andrew Pinski 2008-12-27 22:04:44 UTC