public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/43043]  New: [-fwhole-file] ICE segfault for select_type_4.f90
@ 2010-02-11 18:33 burnus at gcc dot gnu dot org
  2010-02-23 13:12 ` [Bug fortran/43043] " burnus at gcc dot gnu dot org
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: burnus at gcc dot gnu dot org @ 2010-02-11 18:33 UTC (permalink / raw)
  To: gcc-bugs

gfortran -fwhole-file gfortran.dg/select_type_4.f90

gfortran.dg/select_type_4.f90: In function 'MAIN__':
gfortran.dg/select_type_4.f90:96:0: internal compiler error: Segmentation fault

==24333== Invalid read of size 8
==24333==    at 0x55EA3C: gfc_conv_structure (trans-expr.c:4413)
==24333==    by 0x5652E6: gfc_conv_initializer (trans-expr.c:3970)
==24333==    by 0x554EDB: gfc_get_symbol_decl (trans-decl.c:1263)
==24333==    by 0x55592F: generate_local_decl (trans-decl.c:3786)
==24333==    by 0x52B436: traverse_ns (symbol.c:3273)
==24333==    by 0x52B425: traverse_ns (symbol.c:3270)
==24333==    by 0x52B425: traverse_ns (symbol.c:3270)
==24333==    by 0x559D03: gfc_generate_function_code (trans-decl.c:3899)
==24333==    by 0x506A27: gfc_parse_file (parse.c:4071)
==24333==    by 0x53C097: gfc_be_parse_file (f95-lang.c:239)
==24333==    by 0x8253EB: toplev_main (toplev.c:1053)
==24333==    by 0x5EB3BDC: (below main) (in /lib64/libc-2.11.1.so)


The segfault does thus occur for when accessing the argument of
gfc_conv_initializer:

      if (cm->ts.type == BT_CLASS)
        {
          gfc_component *data;
          data = gfc_find_component (cm->ts.u.derived, "$data", true, true);
          val = gfc_conv_initializer (c->expr, &cm->ts,
                                      TREE_TYPE (data->backend_decl),
                                      data->attr.dimension,
                                      data->attr.pointer);


-- 
           Summary: [-fwhole-file] ICE segfault for select_type_4.f90
           Product: gcc
           Version: 4.5.0
            Status: UNCONFIRMED
          Keywords: ice-on-valid-code
          Severity: normal
          Priority: P3
         Component: fortran
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: burnus at gcc dot gnu dot org


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


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

* [Bug fortran/43043] [-fwhole-file] ICE segfault for select_type_4.f90
  2010-02-11 18:33 [Bug fortran/43043] New: [-fwhole-file] ICE segfault for select_type_4.f90 burnus at gcc dot gnu dot org
@ 2010-02-23 13:12 ` burnus at gcc dot gnu dot org
  2010-03-18 18:00 ` pault at gcc dot gnu dot org
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: burnus at gcc dot gnu dot org @ 2010-02-23 13:12 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from burnus at gcc dot gnu dot org  2010-02-23 13:11 -------
Reduced test case:

Program received signal SIGSEGV, Segmentation fault.
0x000000000055cbfd in gfc_trans_structure_assign (dest=<value optimized out>)
    at trans-expr.c:4365
4365          tmp = fold_build3 (COMPONENT_REF, TREE_TYPE (field),

==25346== Invalid read of size 8
==25346==    at 0x55CBFD: gfc_trans_structure_assign (trans-expr.c:4365)
==25346==    by 0x55D32A: gfc_trans_structure_assign (trans-expr.c:4312)
==25346==    by 0x55D32A: gfc_trans_structure_assign (trans-expr.c:4312)
==25346==    by 0x55D7DF: gfc_conv_structure (trans-expr.c:4394)
==25346==    by 0x55DDE1: gfc_trans_assignment_1 (trans-expr.c:5363)

module poly_list
  implicit none
  type :: node_type
    class(node_type), pointer :: next => null()
  end type node_type
end module poly_list

program main
  use poly_list
  implicit none
  type, extends(node_type) :: real_node_type
    real :: x
  end type real_node_type
  type(real_node_type), pointer :: real_node
  allocate(real_node)
end program main


-- 


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


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

* [Bug fortran/43043] [-fwhole-file] ICE segfault for select_type_4.f90
  2010-02-11 18:33 [Bug fortran/43043] New: [-fwhole-file] ICE segfault for select_type_4.f90 burnus at gcc dot gnu dot org
  2010-02-23 13:12 ` [Bug fortran/43043] " burnus at gcc dot gnu dot org
@ 2010-03-18 18:00 ` pault at gcc dot gnu dot org
  2010-03-18 18:41 ` burnus at gcc dot gnu dot org
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: pault at gcc dot gnu dot org @ 2010-03-18 18:00 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from pault at gcc dot gnu dot org  2010-03-18 18:00 -------
The following fixes the PR.  I have not regtested yet but anticipate that all
will be well.

Index: ../trunk/gcc/fortran/trans-expr.c
===================================================================
--- ../trunk/gcc/fortran/trans-expr.c   (revision 157419)
+++ ../trunk/gcc/fortran/trans-expr.c   (working copy)
@@ -4454,6 +4454,8 @@
        {
          gfc_component *data;
          data = gfc_find_component (cm->ts.u.derived, "$data", true, true);
+         if (!data->backend_decl)
+           gfc_get_derived_type (cm->ts.u.derived);
          val = gfc_conv_initializer (c->expr, &cm->ts,
                                      TREE_TYPE (data->backend_decl),
                                      data->attr.dimension,

Paul


-- 


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


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

* [Bug fortran/43043] [-fwhole-file] ICE segfault for select_type_4.f90
  2010-02-11 18:33 [Bug fortran/43043] New: [-fwhole-file] ICE segfault for select_type_4.f90 burnus at gcc dot gnu dot org
  2010-02-23 13:12 ` [Bug fortran/43043] " burnus at gcc dot gnu dot org
  2010-03-18 18:00 ` pault at gcc dot gnu dot org
@ 2010-03-18 18:41 ` burnus at gcc dot gnu dot org
  2010-03-18 19:09 ` pault at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: burnus at gcc dot gnu dot org @ 2010-03-18 18:41 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from burnus at gcc dot gnu dot org  2010-03-18 18:41 -------
(In reply to comment #2)
> The following fixes the PR.  I have not regtested yet but anticipate that all
> will be well.

Looks good. Does is also fix PR 43039? Looking at Thomas' analysis and at the
patch, it might well be the case.


-- 


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


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

* [Bug fortran/43043] [-fwhole-file] ICE segfault for select_type_4.f90
  2010-02-11 18:33 [Bug fortran/43043] New: [-fwhole-file] ICE segfault for select_type_4.f90 burnus at gcc dot gnu dot org
                   ` (2 preceding siblings ...)
  2010-03-18 18:41 ` burnus at gcc dot gnu dot org
@ 2010-03-18 19:09 ` pault at gcc dot gnu dot org
  2010-03-18 20:12 ` pault at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: pault at gcc dot gnu dot org @ 2010-03-18 19:09 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #4 from pault at gcc dot gnu dot org  2010-03-18 19:09 -------
(In reply to comment #3)
> (In reply to comment #2)
> > The following fixes the PR.  I have not regtested yet but anticipate that all
> > will be well.
> 
> Looks good. Does is also fix PR 43039? Looking at Thomas' analysis and at the
> patch, it might well be the case.
> 

I suspect that it is similar but not identical.  Will look after dinner :-)

Paul


-- 


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


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

* [Bug fortran/43043] [-fwhole-file] ICE segfault for select_type_4.f90
  2010-02-11 18:33 [Bug fortran/43043] New: [-fwhole-file] ICE segfault for select_type_4.f90 burnus at gcc dot gnu dot org
                   ` (3 preceding siblings ...)
  2010-03-18 19:09 ` pault at gcc dot gnu dot org
@ 2010-03-18 20:12 ` pault at gcc dot gnu dot org
  2010-03-18 21:24 ` pault at gcc dot gnu dot org
  2010-03-18 21:29 ` pault at gcc dot gnu dot org
  6 siblings, 0 replies; 8+ messages in thread
From: pault at gcc dot gnu dot org @ 2010-03-18 20:12 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #5 from pault at gcc dot gnu dot org  2010-03-18 20:12 -------
(In reply to comment #3)
> (In reply to comment #2)
....snip....
> I suspect that it is similar but not identical.  Will look after dinner :-)
> 
> Paul
>

This surmise is correct.  As soon as the other two fixes have finished
regtesting, I will try what I think is the fix for this one.

I believe the derived type 'dt' at trans-expr.c:507 needs to be checked for its
backend_decl.

Paul


-- 


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


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

* [Bug fortran/43043] [-fwhole-file] ICE segfault for select_type_4.f90
  2010-02-11 18:33 [Bug fortran/43043] New: [-fwhole-file] ICE segfault for select_type_4.f90 burnus at gcc dot gnu dot org
                   ` (4 preceding siblings ...)
  2010-03-18 20:12 ` pault at gcc dot gnu dot org
@ 2010-03-18 21:24 ` pault at gcc dot gnu dot org
  2010-03-18 21:29 ` pault at gcc dot gnu dot org
  6 siblings, 0 replies; 8+ messages in thread
From: pault at gcc dot gnu dot org @ 2010-03-18 21:24 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #6 from pault at gcc dot gnu dot org  2010-03-18 21:24 -------
Subject: Bug 43043

Author: pault
Date: Thu Mar 18 21:23:35 2010
New Revision: 157552

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=157552
Log:
2010-03-18  Paul Thomas  <pault@gcc.gnu.org>

        PR fortran/43039
        * trans-expr.c (conv_parent_component_references): Ensure that
        'dt' has a backend_decl.

        PR fortran/43043
        * trans-expr.c (gfc_conv_structure): Ensure that the derived
        type has a backend_decl.

        PR fortran/43044
        * resolve.c (resolve_global_procedure): Check that the 'cl'
        structure is not NULL.

Modified:
    trunk/gcc/fortran/ChangeLog
    trunk/gcc/fortran/resolve.c
    trunk/gcc/fortran/trans-expr.c


-- 


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


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

* [Bug fortran/43043] [-fwhole-file] ICE segfault for select_type_4.f90
  2010-02-11 18:33 [Bug fortran/43043] New: [-fwhole-file] ICE segfault for select_type_4.f90 burnus at gcc dot gnu dot org
                   ` (5 preceding siblings ...)
  2010-03-18 21:24 ` pault at gcc dot gnu dot org
@ 2010-03-18 21:29 ` pault at gcc dot gnu dot org
  6 siblings, 0 replies; 8+ messages in thread
From: pault at gcc dot gnu dot org @ 2010-03-18 21:29 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #7 from pault at gcc dot gnu dot org  2010-03-18 21:29 -------
Fixed on trunk.

Thanks for the report.

Paul


-- 

pault at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|                            |FIXED


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


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

end of thread, other threads:[~2010-03-18 21:29 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-02-11 18:33 [Bug fortran/43043] New: [-fwhole-file] ICE segfault for select_type_4.f90 burnus at gcc dot gnu dot org
2010-02-23 13:12 ` [Bug fortran/43043] " burnus at gcc dot gnu dot org
2010-03-18 18:00 ` pault at gcc dot gnu dot org
2010-03-18 18:41 ` burnus at gcc dot gnu dot org
2010-03-18 19:09 ` pault at gcc dot gnu dot org
2010-03-18 20:12 ` pault at gcc dot gnu dot org
2010-03-18 21:24 ` pault at gcc dot gnu dot org
2010-03-18 21:29 ` pault 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).