public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/51966] New: internal compiler error
@ 2012-01-23 14:08 peter.tromso at gmail dot com
  2012-01-23 15:02 ` [Bug fortran/51966] " peter.tromso at gmail dot com
                   ` (8 more replies)
  0 siblings, 9 replies; 10+ messages in thread
From: peter.tromso at gmail dot com @ 2012-01-23 14:08 UTC (permalink / raw)
  To: gcc-bugs

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

             Bug #: 51966
           Summary: internal compiler error
    Classification: Unclassified
           Product: gcc
           Version: 4.6.2
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: peter.tromso@gmail.com


Created attachment 26429
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=26429
fortran module part of a larger code

Error message (see complete below):
Compiler_error_example.f90:99:0: internal compiler error: in
gfc_conv_array_constructor_expr, at fortran/trans-expr.c:4126


Small example code which triggers the error is attached.(It is extracted from a
much larger code).

Output from compiler:

$ gfortran -v -save-temps -fdefault-real-8 -ffree-line-length-0  -O2 -c
Compiler_error_example.f90 
Using built-in specs.
COLLECT_GCC=gfortran
COLLECT_LTO_WRAPPER=/global/home/install/gcc/4.6.2/bin/../libexec/gcc/x86_64-unknown-linux-gnu/4.6.2/lto-wrapper
Target: x86_64-unknown-linux-gnu
Configured with: ../gcc-4.6.2/configure --prefix=/global/apps/gcc/4.6.2
Thread model: posix
gcc version 4.6.2 (GCC) 
COLLECT_GCC_OPTIONS='-v' '-save-temps' '-fdefault-real-8'
'-ffree-line-length-0' '-O2' '-c' '-mtune=generic' '-march=x86-64'

/global/home/install/gcc/4.6.2/bin/../libexec/gcc/x86_64-unknown-linux-gnu/4.6.2/f951
Compiler_error_example.f90 -quiet -dumpbase Compiler_error_example.f90
-mtune=generic -march=x86-64 -auxbase Compiler_error_example -O2 -version
-fdefault-real-8 -ffree-line-length-0 -fintrinsic-modules-path
/global/home/install/gcc/4.6.2/bin/../lib/gcc/x86_64-unknown-linux-gnu/4.6.2/finclude
-o Compiler_error_example.s
GNU Fortran (GCC) version 4.6.2 (x86_64-unknown-linux-gnu)
    compiled by GNU C version 4.6.2, GMP version 4.3.2, MPFR version 2.4.2, MPC
version 0.8.1
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
GNU Fortran (GCC) version 4.6.2 (x86_64-unknown-linux-gnu)
    compiled by GNU C version 4.6.2, GMP version 4.3.2, MPFR version 2.4.2, MPC
version 0.8.1
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
Compiler_error_example.f90: In function 'init_ecosystems':
Compiler_error_example.f90:99:0: internal compiler error: in
gfc_conv_array_constructor_expr, at fortran/trans-expr.c:4126
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] 10+ messages in thread

* [Bug fortran/51966] internal compiler error
  2012-01-23 14:08 [Bug fortran/51966] New: internal compiler error peter.tromso at gmail dot com
@ 2012-01-23 15:02 ` peter.tromso at gmail dot com
  2012-01-23 15:19 ` [Bug fortran/51966] [4.6/4.7 Regression] ICE in gfc_conv_array_constructor_expr burnus at gcc dot gnu.org
                   ` (7 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: peter.tromso at gmail dot com @ 2012-01-23 15:02 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #1 from Peter Wind <peter.tromso at gmail dot com> 2012-01-23 14:51:46 UTC ---
Created attachment 26431
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=26431
compile with gfortran fails

small code that exposes the same problem (internal compiler error)


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

* [Bug fortran/51966] [4.6/4.7 Regression] ICE in gfc_conv_array_constructor_expr
  2012-01-23 14:08 [Bug fortran/51966] New: internal compiler error peter.tromso at gmail dot com
  2012-01-23 15:02 ` [Bug fortran/51966] " peter.tromso at gmail dot com
@ 2012-01-23 15:19 ` burnus at gcc dot gnu.org
  2012-01-23 15:21 ` dominiq at lps dot ens.fr
                   ` (6 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: burnus at gcc dot gnu.org @ 2012-01-23 15:19 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |ice-on-valid-code
                 CC|                            |burnus at gcc dot gnu.org
      Known to work|                            |4.1.2, 4.3.4, 4.4.0, 4.5.3
   Target Milestone|---                         |4.6.3
            Summary|internal compiler error     |[4.6/4.7 Regression] ICE in
                   |                            |gfc_conv_array_constructor_
                   |                            |expr
      Known to fail|                            |4.6.2, 4.7.0

--- Comment #2 from Tobias Burnus <burnus at gcc dot gnu.org> 2012-01-23 15:06:13 UTC ---
Fails at the assert of gfc_conv_array_constructor_expr at 
fortran/trans-expr.c:4753:
4753      gcc_assert (ss != NULL && ss != gfc_ss_terminator);

as ss == NULL.


Backtrace:
#1  gfc_conv_expr (se=0x7fffffffd260, expr=0x16bf0b0) at trans-expr.c:5421
#2  0x00000000005d0dfe in gfc_trans_subcomponent_assign (expr=0x16bf0b0,
cm=0x16bf270, dest=0x2aaaacf250a8)
    at fortran/trans-expr.c:5179
#3  gfc_trans_structure_assign (dest=0x2aaaace26280, expr=Unhandled dwarf
expression opcode 0xfa
)
    at fortran/trans-expr.c:5230
#4  0x00000000005d1cb4 in gfc_conv_structure (se=0x7fffffffd740,
expr=0x16c0810, init=0)
    at fortran/trans-expr.c:5257
#5  0x00000000005d241c in gfc_trans_assignment_1 (expr1=0x16c0090,
expr2=0x16c0810, init_flag=false, dealloc=true)


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

* [Bug fortran/51966] [4.6/4.7 Regression] ICE in gfc_conv_array_constructor_expr
  2012-01-23 14:08 [Bug fortran/51966] New: internal compiler error peter.tromso at gmail dot com
  2012-01-23 15:02 ` [Bug fortran/51966] " peter.tromso at gmail dot com
  2012-01-23 15:19 ` [Bug fortran/51966] [4.6/4.7 Regression] ICE in gfc_conv_array_constructor_expr burnus at gcc dot gnu.org
@ 2012-01-23 15:21 ` dominiq at lps dot ens.fr
  2012-01-23 16:53 ` jakub at gcc dot gnu.org
                   ` (5 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: dominiq at lps dot ens.fr @ 2012-01-23 15:21 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2012-01-23
     Ever Confirmed|0                           |1

--- Comment #3 from Dominique d'Humieres <dominiq at lps dot ens.fr> 2012-01-23 15:13:18 UTC ---
Confirmed on trunk and 4.6.2. The failure is the same as in pr51864.

Revision 162456 is OK,
revision 164728 gives the ICE.


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

* [Bug fortran/51966] [4.6/4.7 Regression] ICE in gfc_conv_array_constructor_expr
  2012-01-23 14:08 [Bug fortran/51966] New: internal compiler error peter.tromso at gmail dot com
                   ` (2 preceding siblings ...)
  2012-01-23 15:21 ` dominiq at lps dot ens.fr
@ 2012-01-23 16:53 ` jakub at gcc dot gnu.org
  2012-01-24 10:13 ` burnus at gcc dot gnu.org
                   ` (4 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: jakub at gcc dot gnu.org @ 2012-01-23 16:53 UTC (permalink / raw)
  To: gcc-bugs

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

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] 10+ messages in thread

* [Bug fortran/51966] [4.6/4.7 Regression] ICE in gfc_conv_array_constructor_expr
  2012-01-23 14:08 [Bug fortran/51966] New: internal compiler error peter.tromso at gmail dot com
                   ` (3 preceding siblings ...)
  2012-01-23 16:53 ` jakub at gcc dot gnu.org
@ 2012-01-24 10:13 ` burnus at gcc dot gnu.org
  2012-01-24 10:20 ` burnus at gcc dot gnu.org
                   ` (3 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: burnus at gcc dot gnu.org @ 2012-01-24 10:13 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #4 from Tobias Burnus <burnus at gcc dot gnu.org> 2012-01-24 09:26:56 UTC ---
Reduced test case, which also illustrates another ICE:


module EcoSystem_ml
  implicit none

  type, public:: Deriv
    character(len=10) :: name
  end type

  character(len=8), public, dimension(1), parameter :: &
       DEF_ECOSYSTEMS = (/ "Grid    " /)

  type(Deriv), save :: DepEcoSystem != Deriv(DEF_ECOSYSTEMS(1))
                                    ! ^^^^ ICE in gfc_conv_string_init
contains
  subroutine Init_EcoSystems()
    DepEcoSystem = Deriv(DEF_ECOSYSTEMS(1))
                 ! ^^^ ICE in gfc_conv_array_constructor_expr
  end subroutine Init_EcoSystems
end module EcoSystem_ml


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

* [Bug fortran/51966] [4.6/4.7 Regression] ICE in gfc_conv_array_constructor_expr
  2012-01-23 14:08 [Bug fortran/51966] New: internal compiler error peter.tromso at gmail dot com
                   ` (4 preceding siblings ...)
  2012-01-24 10:13 ` burnus at gcc dot gnu.org
@ 2012-01-24 10:20 ` burnus at gcc dot gnu.org
  2012-01-25  8:39 ` burnus at gcc dot gnu.org
                   ` (2 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: burnus at gcc dot gnu.org @ 2012-01-24 10:20 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #5 from Tobias Burnus <burnus at gcc dot gnu.org> 2012-01-24 09:48:28 UTC ---
(In reply to comment #4)
>   type(Deriv), save :: DepEcoSystem = Deriv(DEF_ECOSYSTEMS(1))

Here, the problem is that in
  #0  gfc_conv_string_init (length=0x2aaaacf3b720, expr=0x16c1170)
expr->type == EXPR_ARRAY. Hence, the following fails:
  gcc_assert (expr->expr_type == EXPR_CONSTANT);

#1  in gfc_conv_initializer at fortran/trans-expr.c:4940
#2  in gfc_conv_structure   at fortran/trans-expr.c:5396
#3  in gfc_conv_initializer at fortran/trans-expr.c:4933
#4  in gfc_get_symbol_decl  at fortran/trans-decl.c:1476

Also that version works with GCC 4.5.


(In reply to comment #3)
> [2009-07-23] Revision 162456 is OK,
> [2010-09-29] revision 164728 gives the ICE.

Also 2010-08-28-r163612 fails.

I wonder whether the patch for PR 44857 (2010-08-04, Rev. 162863) is the
culprit:
http://gcc.gnu.org/ml/fortran/2010-08/msg00034.html


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

* [Bug fortran/51966] [4.6/4.7 Regression] ICE in gfc_conv_array_constructor_expr
  2012-01-23 14:08 [Bug fortran/51966] New: internal compiler error peter.tromso at gmail dot com
                   ` (5 preceding siblings ...)
  2012-01-24 10:20 ` burnus at gcc dot gnu.org
@ 2012-01-25  8:39 ` burnus at gcc dot gnu.org
  2012-01-25  8:50 ` burnus at gcc dot gnu.org
  2012-01-25  8:53 ` burnus at gcc dot gnu.org
  8 siblings, 0 replies; 10+ messages in thread
From: burnus at gcc dot gnu.org @ 2012-01-25  8:39 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #6 from Tobias Burnus <burnus at gcc dot gnu.org> 2012-01-25 06:59:25 UTC ---
Author: burnus
Date: Wed Jan 25 06:59:21 2012
New Revision: 183510

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=183510
Log:
2012-01-24  Tobias Burnus  <burnus@net-b.de>

        PR fortran/51966
        * resolve.c (resolve_structure_cons): Only create an
        array constructors for nonscalars.

2012-01-24  Tobias Burnus  <burnus@net-b.de>

        PR fortran/51966
        * gfortran.dg/derived_constructor_char_3.f90: New.


Added:
    trunk/gcc/testsuite/gfortran.dg/derived_constructor_char_3.f90
Modified:
    trunk/gcc/fortran/ChangeLog
    trunk/gcc/fortran/resolve.c
    trunk/gcc/testsuite/ChangeLog


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

* [Bug fortran/51966] [4.6/4.7 Regression] ICE in gfc_conv_array_constructor_expr
  2012-01-23 14:08 [Bug fortran/51966] New: internal compiler error peter.tromso at gmail dot com
                   ` (6 preceding siblings ...)
  2012-01-25  8:39 ` burnus at gcc dot gnu.org
@ 2012-01-25  8:50 ` burnus at gcc dot gnu.org
  2012-01-25  8:53 ` burnus at gcc dot gnu.org
  8 siblings, 0 replies; 10+ messages in thread
From: burnus at gcc dot gnu.org @ 2012-01-25  8:50 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #7 from Tobias Burnus <burnus at gcc dot gnu.org> 2012-01-25 08:12:02 UTC ---
Author: burnus
Date: Wed Jan 25 08:11:56 2012
New Revision: 183511

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=183511
Log:
2012-01-25  Tobias Burnus  <burnus@net-b.de>

        PR fortran/51966
        * resolve.c (resolve_structure_cons): Only create an
        array constructors for nonscalars.

2012-01-25  Tobias Burnus  <burnus@net-b.de>

        PR fortran/51966
        * gfortran.dg/derived_constructor_char_3.f90: New.


Added:
   
branches/gcc-4_6-branch/gcc/testsuite/gfortran.dg/derived_constructor_char_3.f90
Modified:
    branches/gcc-4_6-branch/gcc/fortran/ChangeLog
    branches/gcc-4_6-branch/gcc/fortran/resolve.c
    branches/gcc-4_6-branch/gcc/testsuite/ChangeLog


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

* [Bug fortran/51966] [4.6/4.7 Regression] ICE in gfc_conv_array_constructor_expr
  2012-01-23 14:08 [Bug fortran/51966] New: internal compiler error peter.tromso at gmail dot com
                   ` (7 preceding siblings ...)
  2012-01-25  8:50 ` burnus at gcc dot gnu.org
@ 2012-01-25  8:53 ` burnus at gcc dot gnu.org
  8 siblings, 0 replies; 10+ messages in thread
From: burnus at gcc dot gnu.org @ 2012-01-25  8:53 UTC (permalink / raw)
  To: gcc-bugs

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

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

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

--- Comment #8 from Tobias Burnus <burnus at gcc dot gnu.org> 2012-01-25 08:26:16 UTC ---
FIXED on the trunk (for 4.7) and on the 4.6 branch.

Thanks for the report!

If the issue blocks you, you could consider downgrading to 4.5. Alternatively,
you could build GCC yourself or download a newer [than today] 4.6 or pre-4.7.0
build. (Cf. http://gcc.gnu.org/wiki/GFortranBinaries and
http://gcc.gnu.org/wiki/GFortranDistros )


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

end of thread, other threads:[~2012-01-25  8:27 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-01-23 14:08 [Bug fortran/51966] New: internal compiler error peter.tromso at gmail dot com
2012-01-23 15:02 ` [Bug fortran/51966] " peter.tromso at gmail dot com
2012-01-23 15:19 ` [Bug fortran/51966] [4.6/4.7 Regression] ICE in gfc_conv_array_constructor_expr burnus at gcc dot gnu.org
2012-01-23 15:21 ` dominiq at lps dot ens.fr
2012-01-23 16:53 ` jakub at gcc dot gnu.org
2012-01-24 10:13 ` burnus at gcc dot gnu.org
2012-01-24 10:20 ` burnus at gcc dot gnu.org
2012-01-25  8:39 ` burnus at gcc dot gnu.org
2012-01-25  8:50 ` burnus at gcc dot gnu.org
2012-01-25  8:53 ` burnus 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).