From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 20023 invoked by alias); 10 Jul 2008 14:44:16 -0000 Received: (qmail 19756 invoked by uid 48); 10 Jul 2008 14:43:24 -0000 Date: Thu, 10 Jul 2008 14:44:00 -0000 Subject: [Bug middle-end/36791] New: ICE with constant argument to __builtin_eh_return X-Bugzilla-Reason: CC Message-ID: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "jfc at mit dot edu" 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: 2008-07/txt/msg01040.txt.bz2 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