public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/57033] New: ICE on extended derived type and default initialization
@ 2013-04-22 16:04 tiloschwarz at gcc dot gnu.org
  2013-04-22 16:13 ` [Bug fortran/57033] [4.7/4.8/4.9 Regression] " dominiq at lps dot ens.fr
                   ` (9 more replies)
  0 siblings, 10 replies; 11+ messages in thread
From: tiloschwarz at gcc dot gnu.org @ 2013-04-22 16:04 UTC (permalink / raw)
  To: gcc-bugs


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

             Bug #: 57033
           Summary: ICE on extended derived type and default
                    initialization
    Classification: Unclassified
           Product: gcc
           Version: 4.9.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: tiloschwarz@gcc.gnu.org


Hi,

with this program

-----------------
program ice

type m
    integer i
    logical :: f = .false.
end type m

type, extends(m) :: me
end type me

type(me) meo

meo = me(1)              ! ICE
!meo = me(1, .false.)    ! does work

end program ice
-----------------

I get:

gfortran-4.4: No ICE
gfortran-4.6: No ICE
gfortran-4.7: ICE
gfortran-4.8: ICE
gfortran-4.9: ICE

Detailed messages from gfortran 4.9.0 20130422 (experimental) (GCC):

./gfortran /home/tschwarz/Developer/Fortran/ice.f95  -B
../i686-pc-linux-gnu/libgfortran -B ../gcc -L
../i686-pc-linux-gnu/libgfortran/.libs -L
../i686-pc-linux-gnu/libquadmath/.libs -v
Driving: ./gfortran /home/tschwarz/Developer/Fortran/ice.f95 -B
../i686-pc-linux-gnu/libgfortran -B ../gcc -L
../i686-pc-linux-gnu/libgfortran/.libs -L
../i686-pc-linux-gnu/libquadmath/.libs -v -l gfortran -l m -shared-libgcc
Reading specs from ../gcc/specs
COLLECT_GCC=./gfortran
COLLECT_LTO_WRAPPER=../gcc/lto-wrapper
Target: i686-pc-linux-gnu
Configured with: ../configure --disable-multilib --enable-languages=fortran
--disable-bootstrap : (reconfigured) ../configure --disable-multilib
--enable-languages=fortran --disable-bootstrap : (reconfigured) ../configure
--disable-multilib --disable-bootstrap --enable-languages=c,fortran,lto
--no-create --no-recursion : (reconfigured) ../configure --disable-multilib
--disable-bootstrap --enable-languages=c,fortran,lto --no-create --no-recursion
Thread model: posix
gcc version 4.9.0 20130422 (experimental) (GCC) 
COLLECT_GCC_OPTIONS='-B' '../i686-pc-linux-gnu/libgfortran' '-B' '../gcc'
'-L../i686-pc-linux-gnu/libgfortran/.libs'
'-L../i686-pc-linux-gnu/libquadmath/.libs' '-v' '-shared-libgcc'
'-mtune=generic' '-march=pentiumpro'
 ../gcc/f951 /home/tschwarz/Developer/Fortran/ice.f95 -quiet -dumpbase ice.f95
-mtune=generic -march=pentiumpro -auxbase ice -version -fintrinsic-modules-path
finclude -o /tmp/ccRAlX1p.s
GNU Fortran (GCC) version 4.9.0 20130422 (experimental) (i686-pc-linux-gnu)
        compiled by GNU C version 4.7.2, GMP version 5.0.5, MPFR version
3.1.0-p10, MPC version 0.9
GGC heuristics: --param ggc-min-expand=30 --param ggc-min-heapsize=4096
GNU Fortran (GCC) version 4.9.0 20130422 (experimental) (i686-pc-linux-gnu)
        compiled by GNU C version 4.7.2, GMP version 5.0.5, MPFR version
3.1.0-p10, MPC version 0.9
GGC heuristics: --param ggc-min-expand=30 --param ggc-min-heapsize=4096
f951: internal compiler error: Segmentation fault
0x85fa860 crash_signal
        ../../gcc/toplev.c:332
0x81b24ac gfc_convert_to_structure_constructor(gfc_expr*, gfc_symbol*,
gfc_expr**, gfc_actual_arglist**, bool)
        ../../gcc/fortran/primary.c:2543
0x81bef6e resolve_generic_f
        ../../gcc/fortran/resolve.c:2463
0x81bef6e resolve_function
        ../../gcc/fortran/resolve.c:2809
0x81bef6e gfc_resolve_expr(gfc_expr*)
        ../../gcc/fortran/resolve.c:5990
0x81c5f8e resolve_code
        ../../gcc/fortran/resolve.c:9588
0x81c8bb9 resolve_codes
        ../../gcc/fortran/resolve.c:14466
0x81b8d3c gfc_resolve
        ../../gcc/fortran/resolve.c:14494
0x81b8d3c gfc_resolve(gfc_namespace*)
        ../../gcc/fortran/resolve.c:14480
0x81ae500 resolve_all_program_units
        ../../gcc/fortran/parse.c:4402
0x81ae500 gfc_parse_file()
        ../../gcc/fortran/parse.c:4651
0x81ec58a gfc_be_parse_file
        ../../gcc/fortran/f95-lang.c:189
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <http://gcc.gnu.org/bugs.html> for instructions.


Regards,
Tilo


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

* [Bug fortran/57033] [4.7/4.8/4.9 Regression] ICE on extended derived type and default initialization
  2013-04-22 16:04 [Bug fortran/57033] New: ICE on extended derived type and default initialization tiloschwarz at gcc dot gnu.org
@ 2013-04-22 16:13 ` dominiq at lps dot ens.fr
  2013-04-22 16:31 ` burnus at gcc dot gnu.org
                   ` (8 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: dominiq at lps dot ens.fr @ 2013-04-22 16:13 UTC (permalink / raw)
  To: gcc-bugs


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

Dominique d'Humieres <dominiq at lps dot ens.fr> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2013-04-22
                 CC|                            |burnus at gcc dot gnu.org
            Summary|ICE on extended derived     |[4.7/4.8/4.9 Regression]
                   |type and default            |ICE on extended derived
                   |initialization              |type and default
                   |                            |initialization
     Ever Confirmed|0                           |1

--- Comment #1 from Dominique d'Humieres <dominiq at lps dot ens.fr> 2013-04-22 16:13:20 UTC ---
This is due to revision 181425.


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

* [Bug fortran/57033] [4.7/4.8/4.9 Regression] ICE on extended derived type and default initialization
  2013-04-22 16:04 [Bug fortran/57033] New: ICE on extended derived type and default initialization tiloschwarz at gcc dot gnu.org
  2013-04-22 16:13 ` [Bug fortran/57033] [4.7/4.8/4.9 Regression] " dominiq at lps dot ens.fr
@ 2013-04-22 16:31 ` burnus at gcc dot gnu.org
  2013-10-25 12:59 ` rguenth at gcc dot gnu.org
                   ` (7 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: burnus at gcc dot gnu.org @ 2013-04-22 16:31 UTC (permalink / raw)
  To: gcc-bugs


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

Tobias Burnus <burnus at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |ice-on-valid-code
   Target Milestone|---                         |4.7.4

--- Comment #2 from Tobias Burnus <burnus at gcc dot gnu.org> 2013-04-22 16:31:07 UTC ---
(In reply to comment #1)
> This is due to revision 181425.

Which was the patch for the DT constructor, cf. PR39427, PR37829,
http://gcc.gnu.org/r181425.


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

* [Bug fortran/57033] [4.7/4.8/4.9 Regression] ICE on extended derived type and default initialization
  2013-04-22 16:04 [Bug fortran/57033] New: ICE on extended derived type and default initialization tiloschwarz at gcc dot gnu.org
  2013-04-22 16:13 ` [Bug fortran/57033] [4.7/4.8/4.9 Regression] " dominiq at lps dot ens.fr
  2013-04-22 16:31 ` burnus at gcc dot gnu.org
@ 2013-10-25 12:59 ` rguenth at gcc dot gnu.org
  2014-01-06 22:32 ` dominiq at lps dot ens.fr
                   ` (6 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: rguenth at gcc dot gnu.org @ 2013-10-25 12:59 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Priority|P3                          |P4


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

* [Bug fortran/57033] [4.7/4.8/4.9 Regression] ICE on extended derived type and default initialization
  2013-04-22 16:04 [Bug fortran/57033] New: ICE on extended derived type and default initialization tiloschwarz at gcc dot gnu.org
                   ` (2 preceding siblings ...)
  2013-10-25 12:59 ` rguenth at gcc dot gnu.org
@ 2014-01-06 22:32 ` dominiq at lps dot ens.fr
  2014-01-26 16:28 ` mikael at gcc dot gnu.org
                   ` (5 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: dominiq at lps dot ens.fr @ 2014-01-06 22:32 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 from Dominique d'Humieres <dominiq at lps dot ens.fr> ---
(In reply to comment #2)
> > This is due to revision 181425.
>
> Which was the patch for the DT constructor, cf. PR39427, PR37829,
> http://gcc.gnu.org/r181425.

This revision also gives pr56674 and pr57129.


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

* [Bug fortran/57033] [4.7/4.8/4.9 Regression] ICE on extended derived type and default initialization
  2013-04-22 16:04 [Bug fortran/57033] New: ICE on extended derived type and default initialization tiloschwarz at gcc dot gnu.org
                   ` (3 preceding siblings ...)
  2014-01-06 22:32 ` dominiq at lps dot ens.fr
@ 2014-01-26 16:28 ` mikael at gcc dot gnu.org
  2014-02-02 11:51 ` mikael at gcc dot gnu.org
                   ` (4 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: mikael at gcc dot gnu.org @ 2014-01-26 16:28 UTC (permalink / raw)
  To: gcc-bugs

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

Mikael Morin <mikael at gcc dot gnu.org> changed:

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

--- Comment #4 from Mikael Morin <mikael at gcc dot gnu.org> ---
Simple fix:

--- a/gcc/fortran/primary.c
+++ b/gcc/fortran/primary.c
@@ -2544,7 +2544,8 @@ gfc_convert_to_structure_constructor (gfc_expr *e,
gfc_symbol *sym, gfc_expr **c
       if (parent && !comp)
     break;

-      actual = actual->next;
+      if (actual)
+        actual = actual->next;
     }

   if (!build_actual_constructor (&comp_head, &ctor_head, sym))


I was about to commit it, then I thought there was something wrong;
Is the following code valid?  It is currently rejected with:

comment_0_modif.f90:14.6:

meo = me(1, 2)              ! ICE
      1
Error: No initializer for component 'j' given in the structure constructor at
(1)!



!!!!!!!!!!!!!!!!
program ice

type m
    integer i
    logical :: f = .false.
end type m

type, extends(m) :: me
    integer :: j
end type me

type(me) meo

meo = me(1, 2)              ! ICE
end program ice
!!!!!!!!!!!!!!!!


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

* [Bug fortran/57033] [4.7/4.8/4.9 Regression] ICE on extended derived type and default initialization
  2013-04-22 16:04 [Bug fortran/57033] New: ICE on extended derived type and default initialization tiloschwarz at gcc dot gnu.org
                   ` (4 preceding siblings ...)
  2014-01-26 16:28 ` mikael at gcc dot gnu.org
@ 2014-02-02 11:51 ` mikael at gcc dot gnu.org
  2014-02-04 14:01 ` mikael at gcc dot gnu.org
                   ` (3 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: mikael at gcc dot gnu.org @ 2014-02-02 11:51 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #5 from Mikael Morin <mikael at gcc dot gnu.org> ---
Author: mikael
Date: Sun Feb  2 11:50:28 2014
New Revision: 207396

URL: http://gcc.gnu.org/viewcvs?rev=207396&root=gcc&view=rev
Log:
fortran/
        PR fortran/57033
        * primary.c (gfc_convert_to_structure_constructor): Avoid null pointer
        dereference.

testsuite/
        PR fortran/57033
        * gfortran.dg/default_initialization_7.f90: New test.


Added:
    trunk/gcc/testsuite/gfortran.dg/default_initialization_7.f90
Modified:
    trunk/gcc/fortran/ChangeLog
    trunk/gcc/fortran/primary.c
    trunk/gcc/testsuite/ChangeLog


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

* [Bug fortran/57033] [4.7/4.8/4.9 Regression] ICE on extended derived type and default initialization
  2013-04-22 16:04 [Bug fortran/57033] New: ICE on extended derived type and default initialization tiloschwarz at gcc dot gnu.org
                   ` (5 preceding siblings ...)
  2014-02-02 11:51 ` mikael at gcc dot gnu.org
@ 2014-02-04 14:01 ` mikael at gcc dot gnu.org
  2014-02-08 20:38 ` mikael at gcc dot gnu.org
                   ` (2 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: mikael at gcc dot gnu.org @ 2014-02-04 14:01 UTC (permalink / raw)
  To: gcc-bugs

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

Mikael Morin <mikael at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |ASSIGNED
           Assignee|unassigned at gcc dot gnu.org      |mikael at gcc dot gnu.org


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

* [Bug fortran/57033] [4.7/4.8/4.9 Regression] ICE on extended derived type and default initialization
  2013-04-22 16:04 [Bug fortran/57033] New: ICE on extended derived type and default initialization tiloschwarz at gcc dot gnu.org
                   ` (6 preceding siblings ...)
  2014-02-04 14:01 ` mikael at gcc dot gnu.org
@ 2014-02-08 20:38 ` mikael at gcc dot gnu.org
  2014-02-08 20:51 ` mikael at gcc dot gnu.org
  2014-02-08 21:04 ` mikael at gcc dot gnu.org
  9 siblings, 0 replies; 11+ messages in thread
From: mikael at gcc dot gnu.org @ 2014-02-08 20:38 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #6 from Mikael Morin <mikael at gcc dot gnu.org> ---
Author: mikael
Date: Sat Feb  8 20:37:55 2014
New Revision: 207634

URL: http://gcc.gnu.org/viewcvs?rev=207634&root=gcc&view=rev
Log:
fortran/
        PR fortran/57033
        * primary.c (gfc_convert_to_structure_constructor): Avoid null pointer
        dereference.

testsuite/
        PR fortran/57033
        * gfortran.dg/default_initialization_7.f90: New test.


Added:
   
branches/gcc-4_8-branch/gcc/testsuite/gfortran.dg/default_initialization_7.f90
Modified:
    branches/gcc-4_8-branch/gcc/fortran/ChangeLog
    branches/gcc-4_8-branch/gcc/fortran/primary.c
    branches/gcc-4_8-branch/gcc/testsuite/ChangeLog


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

* [Bug fortran/57033] [4.7/4.8/4.9 Regression] ICE on extended derived type and default initialization
  2013-04-22 16:04 [Bug fortran/57033] New: ICE on extended derived type and default initialization tiloschwarz at gcc dot gnu.org
                   ` (7 preceding siblings ...)
  2014-02-08 20:38 ` mikael at gcc dot gnu.org
@ 2014-02-08 20:51 ` mikael at gcc dot gnu.org
  2014-02-08 21:04 ` mikael at gcc dot gnu.org
  9 siblings, 0 replies; 11+ messages in thread
From: mikael at gcc dot gnu.org @ 2014-02-08 20:51 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #7 from Mikael Morin <mikael at gcc dot gnu.org> ---
Author: mikael
Date: Sat Feb  8 20:51:01 2014
New Revision: 207635

URL: http://gcc.gnu.org/viewcvs?rev=207635&root=gcc&view=rev
Log:
fortran/
       PR fortran/57033
       * primary.c (gfc_convert_to_structure_constructor): Avoid null pointer
       dereference.

testsuite/
        PR fortran/57033
        * gfortran.dg/default_initialization_7.f90: New test.


Added:
   
branches/gcc-4_7-branch/gcc/testsuite/gfortran.dg/default_initialization_7.f90
Modified:
    branches/gcc-4_7-branch/gcc/fortran/ChangeLog
    branches/gcc-4_7-branch/gcc/fortran/primary.c
    branches/gcc-4_7-branch/gcc/testsuite/ChangeLog


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

* [Bug fortran/57033] [4.7/4.8/4.9 Regression] ICE on extended derived type and default initialization
  2013-04-22 16:04 [Bug fortran/57033] New: ICE on extended derived type and default initialization tiloschwarz at gcc dot gnu.org
                   ` (8 preceding siblings ...)
  2014-02-08 20:51 ` mikael at gcc dot gnu.org
@ 2014-02-08 21:04 ` mikael at gcc dot gnu.org
  9 siblings, 0 replies; 11+ messages in thread
From: mikael at gcc dot gnu.org @ 2014-02-08 21:04 UTC (permalink / raw)
  To: gcc-bugs

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

Mikael Morin <mikael at gcc dot gnu.org> changed:

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

--- Comment #8 from Mikael Morin <mikael at gcc dot gnu.org> ---
Fixed for 4.7.4, 4.8.3 and 4.9.0.
Thanks for the report.


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

end of thread, other threads:[~2014-02-08 21:04 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-04-22 16:04 [Bug fortran/57033] New: ICE on extended derived type and default initialization tiloschwarz at gcc dot gnu.org
2013-04-22 16:13 ` [Bug fortran/57033] [4.7/4.8/4.9 Regression] " dominiq at lps dot ens.fr
2013-04-22 16:31 ` burnus at gcc dot gnu.org
2013-10-25 12:59 ` rguenth at gcc dot gnu.org
2014-01-06 22:32 ` dominiq at lps dot ens.fr
2014-01-26 16:28 ` mikael at gcc dot gnu.org
2014-02-02 11:51 ` mikael at gcc dot gnu.org
2014-02-04 14:01 ` mikael at gcc dot gnu.org
2014-02-08 20:38 ` mikael at gcc dot gnu.org
2014-02-08 20:51 ` mikael at gcc dot gnu.org
2014-02-08 21:04 ` mikael 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).