public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug lto/40725]  New: [LTO] ICE in size_binop, at fold-const.c:2072
@ 2009-07-12 10:14 rguenth at gcc dot gnu dot org
  2009-07-13  5:49 ` [Bug lto/40725] " bje at gcc dot gnu dot org
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2009-07-12 10:14 UTC (permalink / raw)
  To: gcc-bugs

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 <http://gcc.gnu.org/bugs.html> 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


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2009-10-05  8:33 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-07-12 10:14 [Bug lto/40725] New: [LTO] ICE in size_binop, at fold-const.c:2072 rguenth at gcc dot gnu dot org
2009-07-13  5:49 ` [Bug lto/40725] " bje at gcc dot gnu dot org
2009-07-15  0:20 ` bje at gcc dot gnu dot org
2009-07-19  8:51 ` rguenth at gcc dot gnu dot org
2009-07-19  8:51 ` rguenth at gcc dot gnu dot org
2009-10-05  2:54 ` jvdelisle at gcc dot gnu dot org
2009-10-05  8:33 ` rguenth at gcc dot gnu dot org

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