From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 30330 invoked by alias); 12 Jul 2009 10:14:36 -0000 Received: (qmail 30304 invoked by uid 48); 12 Jul 2009 10:14:23 -0000 Date: Sun, 12 Jul 2009 10:14:00 -0000 Subject: [Bug lto/40725] New: [LTO] ICE in size_binop, at fold-const.c:2072 X-Bugzilla-Reason: CC Message-ID: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "rguenth at gcc dot gnu dot org" 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: 2009-07/txt/msg00958.txt.bz2 Reduced from gfortran.dg/bind_c_dts_2.f03. bind_c_dts_2.f03: module bind_c_dts_2 use, intrinsic :: iso_c_binding implicit none type, bind(c) :: my_c_type_1 integer(c_int) :: j end type my_c_type_1 contains subroutine sub0(my_type, expected_j) bind(c) type(my_c_type_1) :: my_type integer(c_int), value :: expected_j if (my_type%j .ne. expected_j) then call abort () end if end subroutine sub0 end module bind_c_dts_2 bind_c_dts_2_driver.c: typedef struct c_type_1 { int j; } c_type_1_t; void sub0(c_type_1_t *c_type, int expected_j); int main(int argc, char **argv) { c_type_1_t c_type; c_type.j = 11; sub0(&c_type, c_type.j); return 0; } ICEs like $ gfortran -o t bind_c_dts_2.f03 bind_c_dts_2_driver.c -flto In file included from bind_c_dts_2_driver.c:20:0, from bind_c_dts_2.f03:13, from :5: bind_c_dts_2.f03: In function 'sub0': bind_c_dts_2.f03:11:0: internal compiler error: in size_binop, at fold-const.c:2072 Please submit a full bug report, with preprocessed source if appropriate. See for instructions. This is because when we stream FIELD_DECLs DECL_FIELD_BIT_OFFSET it is of type bitsizetype but when reading it back in it becomes sizetype. bitsizetype is DImode for both C and Fortran and sizetype is SImode (for a 32bit target). DECL_FIELD_BIT_OFFSET is just bitsize_zero_node here. I have no idea what goes wrong here... -- Summary: [LTO] ICE in size_binop, at fold-const.c:2072 Product: gcc Version: lto Status: UNCONFIRMED Keywords: ice-on-valid-code Severity: normal Priority: P3 Component: lto AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: rguenth at gcc dot gnu dot org GCC target triplet: i?86-*-* http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40725