public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/47082] New: [OOP] ICE in  gfc_conv_component_ref
@ 2010-12-28 20:00 sfilippone at uniroma2 dot it
  2010-12-28 21:05 ` [Bug fortran/47082] " janus at gcc dot gnu.org
                   ` (9 more replies)
  0 siblings, 10 replies; 11+ messages in thread
From: sfilippone at uniroma2 dot it @ 2010-12-28 20:00 UTC (permalink / raw)
  To: gcc-bugs

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

           Summary: [OOP] ICE in  gfc_conv_component_ref
           Product: gcc
           Version: 4.6.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: sfilippone@uniroma2.it


Created attachment 22858
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=22858
test case

trunk at r168261: 
[sfilippo@localhost V1]$ gfortran -v
Using built-in specs.
COLLECT_GCC=gfortran
COLLECT_LTO_WRAPPER=/usr/local/gnu46/libexec/gcc/x86_64-unknown-linux-gnu/4.6.0/lto-wrapper
Target: x86_64-unknown-linux-gnu
Configured with: ../gcc/configure --prefix=/usr/local/gnu46
--enable-languages=c,c++,fortran --with-gmp=/home/travel/GCC/gmp
--with-mpfr=/home/travel/GCC/mpfr --with-mpc=/home/travel/GCC/mpc :
(reconfigured) ../gcc/configure --prefix=/usr/local/gnu46
--with-gmp=/home/travel/GCC/gmp --with-mpfr=/home/travel/GCC/mpfr
--with-mpc=/home/travel/GCC/mpc --enable-languages=c,c++,fortran,lto
--no-create --no-recursion : (reconfigured) ../gcc/configure
--prefix=/usr/local/gnu46 --with-gmp=/home/travel/GCC/gmp
--with-mpfr=/home/travel/GCC/mpfr --with-mpc=/home/travel/GCC/mpc
--enable-languages=c,c++,fortran,lto --no-create --no-recursion :
(reconfigured) ../gcc/configure --prefix=/usr/local/gnu46
--with-gmp=/home/travel/GCC/gmp --with-mpfr=/home/travel/GCC/mpfr
--with-mpc=/home/travel/GCC/mpc --enable-languages=c,c++,fortran,lto
--no-create --no-recursion : (reconfigured) ../gcc/configure
--prefix=/usr/local/gnu46 --with-gmp=/home/travel/GCC/gmp
--with-mpfr=/home/travel/GCC/mpfr --with-mpc=/home/travel/GCC/mpc
--enable-languages=c,c++,fortran,lto --no-create --no-recursion :
(reconfigured) ../gcc/configure --prefix=/usr/local/gnu46
--with-gmp=/home/travel/GCC/gmp --with-mpfr=/home/travel/GCC/mpfr
--with-mpc=/home/travel/GCC/mpc --enable-languages=c,c++,fortran,lto
--no-create --no-recursion : (reconfigured) ../gcc/configure
--prefix=/usr/local/gnu46 --with-gmp=/home/travel/GCC/gmp
--with-mpfr=/home/travel/GCC/mpfr --with-mpc=/home/travel/GCC/mpc
--enable-languages=c,c++,fortran,lto --no-create --no-recursion :
(reconfigured) ../gcc/configure --prefix=/usr/local/gnu46
--with-gmp=/home/travel/GCC/gmp --with-mpfr=/home/travel/GCC/mpfr
--with-mpc=/home/travel/GCC/mpc --enable-languages=c,c++,fortran,lto
--no-create --no-recursion : (reconfigured) ../gcc/configure
--prefix=/usr/local/gnu46 --with-gmp=/home/travel/GCC/gmp
--with-mpfr=/home/travel/GCC/mpfr --with-mpc=/home/travel/GCC/mpc
--enable-languages=c,c++,fortran,lto --no-create --no-recursion
Thread model: posix
gcc version 4.6.0 20101227 (experimental) (GCC) 
[sfilippo@localhost V1]$ gfortran -ggdb -fbacktrace bug29_1.f90 -c
bug29_1.f90: In function 'psb_cdall':
bug29_1.f90:244:0: internal compiler error: in gfc_conv_component_ref, at
fortran/trans-expr.c:501
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.


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

* [Bug fortran/47082] [OOP] ICE in  gfc_conv_component_ref
  2010-12-28 20:00 [Bug fortran/47082] New: [OOP] ICE in gfc_conv_component_ref sfilippone at uniroma2 dot it
@ 2010-12-28 21:05 ` janus at gcc dot gnu.org
  2010-12-29 15:59 ` janus at gcc dot gnu.org
                   ` (8 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: janus at gcc dot gnu.org @ 2010-12-28 21:05 UTC (permalink / raw)
  To: gcc-bugs

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

janus at gcc dot gnu.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |ice-on-valid-code
                 CC|                            |janus at gcc dot gnu.org

--- Comment #1 from janus at gcc dot gnu.org 2010-12-28 21:05:34 UTC ---
Here is a reduced test case:


module m0
  implicit none
  type :: t0
  end type
end module

module m1
  use m0
  implicit none
  type, extends(t0) :: t1
    integer, allocatable :: i
  end type
  class(t0), pointer, private :: idxmap
end module

module m2
  use m0
  implicit none
  type t2
    class(t0), allocatable :: indxmap
  end type
end module

program bug29
  use m1
  use m2
  implicit none
  type(t2) :: desc
  allocate(t1 :: desc%indxmap)
end


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

* [Bug fortran/47082] [OOP] ICE in  gfc_conv_component_ref
  2010-12-28 20:00 [Bug fortran/47082] New: [OOP] ICE in gfc_conv_component_ref sfilippone at uniroma2 dot it
  2010-12-28 21:05 ` [Bug fortran/47082] " janus at gcc dot gnu.org
@ 2010-12-29 15:59 ` janus at gcc dot gnu.org
  2011-01-04 13:28 ` janus at gcc dot gnu.org
                   ` (7 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: janus at gcc dot gnu.org @ 2010-12-29 15:59 UTC (permalink / raw)
  To: gcc-bugs

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

janus at gcc dot gnu.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2010.12.29 15:58:51
     Ever Confirmed|0                           |1

--- Comment #2 from janus at gcc dot gnu.org 2010-12-29 15:58:51 UTC ---
I have stared at this problem for a while now, but I'm still puzzled about its
origin. All I could come up with is this ad-hoc patch:

Index: gcc/fortran/trans-expr.c
===================================================================
--- gcc/fortran/trans-expr.c    (revision 168301)
+++ gcc/fortran/trans-expr.c    (working copy)
@@ -6085,6 +6085,7 @@ gfc_trans_class_init_assign (gfc_code *code)

   rhs = gfc_copy_expr (code->expr1);
   gfc_add_vptr_component (rhs);
+  gfc_get_derived_type (rhs->ts.u.derived);
   gfc_add_def_init_component (rhs);

   sz = gfc_copy_expr (code->expr1);


This does not solve the problem fully, but it reduces it to PR46448:

/tmp/cc9UG1CN.s: Assembler messages:
/tmp/cc9UG1CN.s:65: Error: symbol `__copy_m0_t0_' is already defined


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

* [Bug fortran/47082] [OOP] ICE in  gfc_conv_component_ref
  2010-12-28 20:00 [Bug fortran/47082] New: [OOP] ICE in gfc_conv_component_ref sfilippone at uniroma2 dot it
  2010-12-28 21:05 ` [Bug fortran/47082] " janus at gcc dot gnu.org
  2010-12-29 15:59 ` janus at gcc dot gnu.org
@ 2011-01-04 13:28 ` janus at gcc dot gnu.org
  2011-01-04 13:31 ` [Bug fortran/47082] [4.6 Regression] " janus at gcc dot gnu.org
                   ` (6 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: janus at gcc dot gnu.org @ 2011-01-04 13:28 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 from janus at gcc dot gnu.org 2011-01-04 13:28:33 UTC ---
(In reply to comment #2)
> This does not solve the problem fully, but it reduces it to PR46448:
> 
> /tmp/cc9UG1CN.s: Assembler messages:
> /tmp/cc9UG1CN.s:65: Error: symbol `__copy_m0_t0_' is already defined

After PR46448 is solved now, the patch fully fixes the test case. Still it
feels a bit hackish.


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

* [Bug fortran/47082] [4.6 Regression] [OOP] ICE in gfc_conv_component_ref
  2010-12-28 20:00 [Bug fortran/47082] New: [OOP] ICE in gfc_conv_component_ref sfilippone at uniroma2 dot it
                   ` (2 preceding siblings ...)
  2011-01-04 13:28 ` janus at gcc dot gnu.org
@ 2011-01-04 13:31 ` janus at gcc dot gnu.org
  2011-01-14 14:24 ` rguenth at gcc dot gnu.org
                   ` (5 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: janus at gcc dot gnu.org @ 2011-01-04 13:31 UTC (permalink / raw)
  To: gcc-bugs

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

janus at gcc dot gnu.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|[OOP] ICE in                |[4.6 Regression] [OOP] ICE
                   |gfc_conv_component_ref      |in gfc_conv_component_ref

--- Comment #4 from janus at gcc dot gnu.org 2011-01-04 13:31:11 UTC ---
Btw, since 4.5 cleanly compiles comment #1, this clearly is a regression.


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

* [Bug fortran/47082] [4.6 Regression] [OOP] ICE in gfc_conv_component_ref
  2010-12-28 20:00 [Bug fortran/47082] New: [OOP] ICE in gfc_conv_component_ref sfilippone at uniroma2 dot it
                   ` (3 preceding siblings ...)
  2011-01-04 13:31 ` [Bug fortran/47082] [4.6 Regression] " janus at gcc dot gnu.org
@ 2011-01-14 14:24 ` rguenth at gcc dot gnu.org
  2011-01-17 19:03 ` jakub at gcc dot gnu.org
                   ` (4 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: rguenth at gcc dot gnu.org @ 2011-01-14 14:24 UTC (permalink / raw)
  To: gcc-bugs

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

Richard Guenther <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |4.6.0


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

* [Bug fortran/47082] [4.6 Regression] [OOP] ICE in gfc_conv_component_ref
  2010-12-28 20:00 [Bug fortran/47082] New: [OOP] ICE in gfc_conv_component_ref sfilippone at uniroma2 dot it
                   ` (4 preceding siblings ...)
  2011-01-14 14:24 ` rguenth at gcc dot gnu.org
@ 2011-01-17 19:03 ` jakub at gcc dot gnu.org
  2011-02-01 10:00 ` pault at gcc dot gnu.org
                   ` (3 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: jakub at gcc dot gnu.org @ 2011-01-17 19:03 UTC (permalink / raw)
  To: gcc-bugs

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

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Priority|P3                          |P4
                 CC|                            |jakub at gcc dot gnu.org


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

* [Bug fortran/47082] [4.6 Regression] [OOP] ICE in gfc_conv_component_ref
  2010-12-28 20:00 [Bug fortran/47082] New: [OOP] ICE in gfc_conv_component_ref sfilippone at uniroma2 dot it
                   ` (5 preceding siblings ...)
  2011-01-17 19:03 ` jakub at gcc dot gnu.org
@ 2011-02-01 10:00 ` pault at gcc dot gnu.org
  2011-02-01 22:32 ` pault at gcc dot gnu.org
                   ` (2 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: pault at gcc dot gnu.org @ 2011-02-01 10:00 UTC (permalink / raw)
  To: gcc-bugs

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

Paul Thomas <pault at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |pault at gcc dot gnu.org

--- Comment #5 from Paul Thomas <pault at gcc dot gnu.org> 2011-02-01 10:00:14 UTC ---
(In reply to comment #3)
> (In reply to comment #2)
> > This does not solve the problem fully, but it reduces it to PR46448:
> > 
> > /tmp/cc9UG1CN.s: Assembler messages:
> > /tmp/cc9UG1CN.s:65: Error: symbol `__copy_m0_t0_' is already defined
> 
> After PR46448 is solved now, the patch fully fixes the test case. Still it
> feels a bit hackish.

Not entirely:
If you change the line in module m1 from-
  class(t0), pointer, private :: idxmap
to
  type(t0), pointer, private :: idxmap

then the reduced testcase of comment #1 compiles.  Comparing themain programme
between the two, you will see a symtree '@2' in the failing case that points to
the vtype, '__vtype_m0_T0'.  I would guess that this has no backend_decl.

Calling gfc_get_derived_type then associates (I think) the backend_decls with
that of the symtree '__vtype_m0_T0', which is somehow pointing to a different
symbol.

I will explore further at lunchtime.

Paul


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

* [Bug fortran/47082] [4.6 Regression] [OOP] ICE in gfc_conv_component_ref
  2010-12-28 20:00 [Bug fortran/47082] New: [OOP] ICE in gfc_conv_component_ref sfilippone at uniroma2 dot it
                   ` (6 preceding siblings ...)
  2011-02-01 10:00 ` pault at gcc dot gnu.org
@ 2011-02-01 22:32 ` pault at gcc dot gnu.org
  2011-02-02 19:51 ` pault at gcc dot gnu.org
  2011-02-02 19:52 ` pault at gcc dot gnu.org
  9 siblings, 0 replies; 11+ messages in thread
From: pault at gcc dot gnu.org @ 2011-02-01 22:32 UTC (permalink / raw)
  To: gcc-bugs

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

Paul Thomas <pault at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         AssignedTo|unassigned at gcc dot       |pault at gcc dot gnu.org
                   |gnu.org                     |

--- Comment #6 from Paul Thomas <pault at gcc dot gnu.org> 2011-02-01 22:32:21 UTC ---
Created attachment 23206
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=23206
Fix for the PR and a tidy up in module.c

Janus's patch is fine.  My comment is incorrect; the tidy-up in module.c gets
rid of the unique symtrees but the segfault remains.  I have commented as to
why the fix of comment #3 works.

I'll submit it in Janus's name.

Paul


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

* [Bug fortran/47082] [4.6 Regression] [OOP] ICE in gfc_conv_component_ref
  2010-12-28 20:00 [Bug fortran/47082] New: [OOP] ICE in gfc_conv_component_ref sfilippone at uniroma2 dot it
                   ` (7 preceding siblings ...)
  2011-02-01 22:32 ` pault at gcc dot gnu.org
@ 2011-02-02 19:51 ` pault at gcc dot gnu.org
  2011-02-02 19:52 ` pault at gcc dot gnu.org
  9 siblings, 0 replies; 11+ messages in thread
From: pault at gcc dot gnu.org @ 2011-02-02 19:51 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #7 from Paul Thomas <pault at gcc dot gnu.org> 2011-02-02 19:51:07 UTC ---
Author: pault
Date: Wed Feb  2 19:51:03 2011
New Revision: 169767

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=169767
Log:
2011-02-02  Janus Weil  <janus@gcc.gnu.org>
        Paul Thomas  <pault@gcc.gnu.org>

    PR fortran/47082
    * trans-expr.c (gfc_trans_class_init_assign): Add call to
    gfc_get_derived_type.
    * module.c (read_cleanup): Do not use unique_symtrees for vtabs
    or vtypes.

2011-02-02  Janus Weil  <janus@gcc.gnu.org>
        Paul Thomas  <pault@gcc.gnu.org>

    PR fortran/47082
    * gfortran.dg/class_37.f03 : New test.


Added:
    trunk/gcc/testsuite/gfortran.dg/class_37.f03
Modified:
    trunk/gcc/fortran/ChangeLog
    trunk/gcc/fortran/module.c
    trunk/gcc/fortran/trans-expr.c
    trunk/gcc/testsuite/ChangeLog


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

* [Bug fortran/47082] [4.6 Regression] [OOP] ICE in gfc_conv_component_ref
  2010-12-28 20:00 [Bug fortran/47082] New: [OOP] ICE in gfc_conv_component_ref sfilippone at uniroma2 dot it
                   ` (8 preceding siblings ...)
  2011-02-02 19:51 ` pault at gcc dot gnu.org
@ 2011-02-02 19:52 ` pault at gcc dot gnu.org
  9 siblings, 0 replies; 11+ messages in thread
From: pault at gcc dot gnu.org @ 2011-02-02 19:52 UTC (permalink / raw)
  To: gcc-bugs

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

Paul Thomas <pault at gcc dot gnu.org> changed:

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

--- Comment #8 from Paul Thomas <pault at gcc dot gnu.org> 2011-02-02 19:52:28 UTC ---
Fixed on trunk.

Grazie, Salvatore!

Paul and Janus


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

end of thread, other threads:[~2011-02-02 19:52 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-12-28 20:00 [Bug fortran/47082] New: [OOP] ICE in gfc_conv_component_ref sfilippone at uniroma2 dot it
2010-12-28 21:05 ` [Bug fortran/47082] " janus at gcc dot gnu.org
2010-12-29 15:59 ` janus at gcc dot gnu.org
2011-01-04 13:28 ` janus at gcc dot gnu.org
2011-01-04 13:31 ` [Bug fortran/47082] [4.6 Regression] " janus at gcc dot gnu.org
2011-01-14 14:24 ` rguenth at gcc dot gnu.org
2011-01-17 19:03 ` jakub at gcc dot gnu.org
2011-02-01 10:00 ` pault at gcc dot gnu.org
2011-02-01 22:32 ` pault at gcc dot gnu.org
2011-02-02 19:51 ` pault at gcc dot gnu.org
2011-02-02 19:52 ` pault at gcc dot gnu.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).