public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/50050] New: Internal compiler error free_expr0 at expr.c:3709 via gfc_done_2
@ 2011-08-11 21:50 sigurdkn at gmail dot com
  2011-08-12 11:45 ` [Bug fortran/50050] " mikael at gcc dot gnu.org
                   ` (17 more replies)
  0 siblings, 18 replies; 19+ messages in thread
From: sigurdkn at gmail dot com @ 2011-08-11 21:50 UTC (permalink / raw)
  To: gcc-bugs

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

             Bug #: 50050
           Summary: Internal compiler error free_expr0 at expr.c:3709 via
                    gfc_done_2
    Classification: Unclassified
           Product: gcc
           Version: 4.7.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: sigurdkn@gmail.com


Created attachment 24988
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=24988
Trigger bug with "gfortran bug.f90"

The attached minimal program triggers an internal compiler bug in all versions
of gfortran I have encountered. That includes

GNU Fortran (GCC) 4.7.0 20110811 (experimental) - linux 2.6.32-33 - ubuntu
GNU Fortran (GCC) 4.7.0 20110713 (experimental) - linux 2.6.18-238 - red hat 5
GNU Fortran (GCC) 4.6.0 - linux 2.6.32-33 - ubuntu
GNU Fortran (Gentoo 4.5.3 p1.0, pie-0.4.5) 4.5.3
GNU Fortran (GCC) 4.5.3 - macosx
GNU Fortran (Ubuntu 4.4.3-4ubuntu5) 4.4.3

To trigger the bug, simply do

  gfortran bug.f90

Optimization level and other options do not seem to matter (but I have not
tried all). Note that many of the strange details in bug.f90 are necessary to
trigger the bug. For example, one of the indices of data must be a range while
the other must be a number. The => null() part is also necessary. And the array
must have at least two dimensions.

The different compilers involved where configured differently and built on
different systems, so I do not think the configuration matters much. But here
is the configuration from 4.7.0 20110811:

 sigurdkn@kaguya:~/code$ ~/local/gcc-build-debug/gcc/gfortran -v
 Using built-in specs.
 COLLECT_GCC=/home/sigurdkn/local/gcc-build-debug/gcc/gfortran
 Target: x86_64-unknown-linux-gnu
 Configured with: /home/sigurdkn/local/gcc-svn/configure
--prefix=/home/sigurdkn /local --program-suffix=-dbg
--enable-stage1-languages=c,fortran,c++
 Thread model: posix
 gcc version 4.7.0 20110811 (experimental) (GCC) 

Here is a stack trace from 4.7.0 20110811:

#0  *__GI___libc_free (mem=0x61) at malloc.c:3709
#1  0x00000000004bb5f5 in free_expr0 (e=0x1adca70)
    at /home/sigurdkn/local/gcc-svn/gcc/fortran/expr.c:479
#2  0x00000000004bb6d2 in gfc_free_expr (e=0x1adca70)
    at /home/sigurdkn/local/gcc-svn/gcc/fortran/expr.c:497
#3  0x0000000000544f42 in gfc_free_statement (p=0x1adc9a0)
    at /home/sigurdkn/local/gcc-svn/gcc/fortran/st.c:84
#4  0x000000000054515c in gfc_free_statements (p=0x1adc9a0)
    at /home/sigurdkn/local/gcc-svn/gcc/fortran/st.c:233
#5  0x000000000054c238 in gfc_free_namespace (ns=0x1ad8d30)
    at /home/sigurdkn/local/gcc-svn/gcc/fortran/symbol.c:3246
#6  0x000000000054c3d2 in gfc_symbol_done_2 ()
    at /home/sigurdkn/local/gcc-svn/gcc/fortran/symbol.c:3291
#7  0x00000000004f9347 in gfc_done_2 ()
    at /home/sigurdkn/local/gcc-svn/gcc/fortran/misc.c:266
#8  0x000000000050f951 in translate_all_program_units
(gfc_global_ns_list=0x1ad8d30, 
    main_in_tu=1 '\001') at
/home/sigurdkn/local/gcc-svn/gcc/fortran/parse.c:4334
#9  0x000000000050fecc in gfc_parse_file ()
    at /home/sigurdkn/local/gcc-svn/gcc/fortran/parse.c:4528
#10 0x0000000000555245 in gfc_be_parse_file ()
    at /home/sigurdkn/local/gcc-svn/gcc/fortran/f95-lang.c:250
#11 0x0000000000b36e7e in compile_file ()
    at /home/sigurdkn/local/gcc-svn/gcc/toplev.c:548
#12 0x0000000000b39107 in do_compile () at
/home/sigurdkn/local/gcc-svn/gcc/toplev.c:1886
#13 0x0000000000b39277 in toplev_main (argc=2, argv=0x7fffffffe578)
    at /home/sigurdkn/local/gcc-svn/gcc/toplev.c:1962
#14 0x00000000006099a0 in main (argc=2, argv=0x7fffffffe578)
    at /home/sigurdkn/local/gcc-svn/gcc/main.c:36


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

* [Bug fortran/50050] Internal compiler error free_expr0 at expr.c:3709 via gfc_done_2
  2011-08-11 21:50 [Bug fortran/50050] New: Internal compiler error free_expr0 at expr.c:3709 via gfc_done_2 sigurdkn at gmail dot com
@ 2011-08-12 11:45 ` mikael at gcc dot gnu.org
  2011-08-12 12:19 ` mikael at gcc dot gnu.org
                   ` (16 subsequent siblings)
  17 siblings, 0 replies; 19+ messages in thread
From: mikael at gcc dot gnu.org @ 2011-08-12 11:45 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2011-08-12
                 CC|                            |mikael at gcc dot gnu.org
     Ever Confirmed|0                           |1

--- Comment #1 from Mikael Morin <mikael at gcc dot gnu.org> 2011-08-12 11:41:38 UTC ---
Confirmed on recent (patched, but I don't think it matters) trunk on freeBSD:
GNU Fortran (GCC) 4.7.0 20110806 (experimental)

$ valgrind ~/gcc4x/build/gcc/f951 comment_0.f90
==5119== Memcheck, a memory error detector
==5119== Copyright (C) 2002-2010, and GNU GPL'd, by Julian Seward et al.
==5119== Using Valgrind-3.6.0 and LibVEX; rerun with -h for copyright info
==5119== Command: /home/mik/gcc4x/build/gcc/f951 comment_0.f90
==5119== 
 bug main==5119== Invalid read of size 4
==5119==    at 0x1E3AB90: __gmpz_clear (in /usr/local/lib/libgmp.so.10)
==5119==    by 0x4DBA0E: free_expr0(gfc_expr*) (expr.c:479)
==5119==    by 0x4DBB6D: gfc_free_expr(gfc_expr*) (expr.c:497)
==5119==    by 0x543421: gfc_free_statement(gfc_code*) (st.c:84)
==5119==    by 0x54358C: gfc_free_statements(gfc_code*) (st.c:233)
==5119==    by 0x5482B1: gfc_free_namespace(gfc_namespace*) (symbol.c:3246)
==5119==    by 0x548BFF: gfc_symbol_done_2() (symbol.c:3291)
==5119==    by 0x50A008: gfc_done_2() (misc.c:266)
==5119==    by 0x51BD03: gfc_parse_file() (parse.c:4334)
==5119==    by 0x554085: gfc_be_parse_file() (f95-lang.c:250)
==5119==    by 0x8E64D7: toplev_main(int, char**) (toplev.c:548)
==5119==    by 0x4B5F1B: (below main) (in /usr/home/mik/gcc4x/build/gcc/f951)
==5119==  Address 0x247b4d0 is 0 bytes after a block of size 16 alloc'd
==5119==    at 0x25990A: calloc (in
/usr/local/lib/valgrind/vgpreload_memcheck-amd64-freebsd.so)
==5119==    by 0xDF4348: xcalloc (xmalloc.c:162)
==5119==    by 0x4DBD53: gfc_copy_shape(__mpz_struct (*) [1], int) (expr.c:689)
==5119==    by 0x4DBDE5: gfc_copy_expr(gfc_expr*) (expr.c:391)
==5119==    by 0x525908: gfc_expr_to_initialize(gfc_expr*) (resolve.c:6549)
==5119==    by 0x53021A: resolve_allocate_deallocate(gfc_code*, char const*)
(resolve.c:6864)
==5119==    by 0x532796: resolve_code(gfc_code*, gfc_namespace*)
(resolve.c:9302)
==5119==    by 0x53429E: resolve_codes(gfc_namespace*) (resolve.c:13757)
==5119==    by 0x525D07: gfc_resolve(gfc_namespace*) (resolve.c:13784)
==5119==    by 0x51BBAF: gfc_parse_file() (parse.c:4247)
==5119==    by 0x554085: gfc_be_parse_file() (f95-lang.c:250)
==5119==    by 0x8E64D7: toplev_main(int, char**) (toplev.c:548)


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

* [Bug fortran/50050] Internal compiler error free_expr0 at expr.c:3709 via gfc_done_2
  2011-08-11 21:50 [Bug fortran/50050] New: Internal compiler error free_expr0 at expr.c:3709 via gfc_done_2 sigurdkn at gmail dot com
  2011-08-12 11:45 ` [Bug fortran/50050] " mikael at gcc dot gnu.org
@ 2011-08-12 12:19 ` mikael at gcc dot gnu.org
  2011-08-12 12:47 ` mikael at gcc dot gnu.org
                   ` (15 subsequent siblings)
  17 siblings, 0 replies; 19+ messages in thread
From: mikael at gcc dot gnu.org @ 2011-08-12 12:19 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #2 from Mikael Morin <mikael at gcc dot gnu.org> 2011-08-12 11:54:27 UTC ---
In gfc_expr_to_initialize, we copy an expression, 

  result = gfc_copy_expr (e);


and then change it to something else:

  /* Change the last array reference from AR_ELEMENT to AR_FULL.  */
  for (ref = result->ref; ref; ref = ref->next)
    if (ref->type == REF_ARRAY && ref->next == NULL)
      {
    ref->u.ar.type = AR_FULL;

    for (i = 0; i < ref->u.ar.dimen; i++)
      ref->u.ar.start[i] = ref->u.ar.end[i] = ref->u.ar.stride[i] = NULL;

    result->rank = ref->u.ar.dimen;
    break;
      }


Not very surprising that it fails.


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

* [Bug fortran/50050] Internal compiler error free_expr0 at expr.c:3709 via gfc_done_2
  2011-08-11 21:50 [Bug fortran/50050] New: Internal compiler error free_expr0 at expr.c:3709 via gfc_done_2 sigurdkn at gmail dot com
  2011-08-12 11:45 ` [Bug fortran/50050] " mikael at gcc dot gnu.org
  2011-08-12 12:19 ` mikael at gcc dot gnu.org
@ 2011-08-12 12:47 ` mikael at gcc dot gnu.org
  2011-08-20 14:55 ` mikael at gcc dot gnu.org
                   ` (14 subsequent siblings)
  17 siblings, 0 replies; 19+ messages in thread
From: mikael at gcc dot gnu.org @ 2011-08-12 12:47 UTC (permalink / raw)
  To: gcc-bugs

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

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

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

--- Comment #3 from Mikael Morin <mikael at gcc dot gnu.org> 2011-08-12 12:38:45 UTC ---
Created attachment 24991
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=24991
Tentative patch

This should fix the issue.


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

* [Bug fortran/50050] Internal compiler error free_expr0 at expr.c:3709 via gfc_done_2
  2011-08-11 21:50 [Bug fortran/50050] New: Internal compiler error free_expr0 at expr.c:3709 via gfc_done_2 sigurdkn at gmail dot com
                   ` (2 preceding siblings ...)
  2011-08-12 12:47 ` mikael at gcc dot gnu.org
@ 2011-08-20 14:55 ` mikael at gcc dot gnu.org
  2011-08-22 14:27 ` mikael at gcc dot gnu.org
                   ` (13 subsequent siblings)
  17 siblings, 0 replies; 19+ messages in thread
From: mikael at gcc dot gnu.org @ 2011-08-20 14:55 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #4 from Mikael Morin <mikael at gcc dot gnu.org> 2011-08-20 14:51:40 UTC ---
Patch posted at:
http://gcc.gnu.org/ml/fortran/2011-08/msg00106.html


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

* [Bug fortran/50050] Internal compiler error free_expr0 at expr.c:3709 via gfc_done_2
  2011-08-11 21:50 [Bug fortran/50050] New: Internal compiler error free_expr0 at expr.c:3709 via gfc_done_2 sigurdkn at gmail dot com
                   ` (3 preceding siblings ...)
  2011-08-20 14:55 ` mikael at gcc dot gnu.org
@ 2011-08-22 14:27 ` mikael at gcc dot gnu.org
  2011-08-22 20:29 ` mikael at gcc dot gnu.org
                   ` (12 subsequent siblings)
  17 siblings, 0 replies; 19+ messages in thread
From: mikael at gcc dot gnu.org @ 2011-08-22 14:27 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #5 from Mikael Morin <mikael at gcc dot gnu.org> 2011-08-22 14:07:34 UTC ---
Author: mikael
Date: Mon Aug 22 14:07:30 2011
New Revision: 177956

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=177956
Log:
2011-08-22  Mikael Morin  <mikael.morin@gcc.gnu.org>

    PR fortran/50050
    * gfortran.h (gfc_clear_shape, gfc_free_shape): New prototypes.
    * expr.c (gfc_clear_shape, gfc_free_shape): New functions.
    (free_expr0): Re-use gfc_free_shape.
    * trans-expr.c (gfc_trans_subarray_assign): Ditto.
    * trans-io.c (transfer_array_component): Ditto.
    * resolve.c (check_host_association): Ditto.
    (gfc_expr_to_initialize): Don't force the rank value and free the shape
    after updating the expression. Recalculate shape and rank.
    (resolve_where_shape): Re-use gfc_clear_shape.
    * array.c (gfc_array_ref_shape): Ditto.

2011-08-22  Mikael Morin  <mikael.morin@gcc.gnu.org>

    PR fortran/50050
    * gfortran.dg/alloc_comp_initializer_3.f90: New test.


Added:
    trunk/gcc/testsuite/gfortran.dg/alloc_comp_initializer_3.f90
Modified:
    trunk/gcc/fortran/ChangeLog
    trunk/gcc/fortran/array.c
    trunk/gcc/fortran/expr.c
    trunk/gcc/fortran/gfortran.h
    trunk/gcc/fortran/resolve.c
    trunk/gcc/fortran/trans-expr.c
    trunk/gcc/fortran/trans-io.c
    trunk/gcc/testsuite/ChangeLog


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

* [Bug fortran/50050] Internal compiler error free_expr0 at expr.c:3709 via gfc_done_2
  2011-08-11 21:50 [Bug fortran/50050] New: Internal compiler error free_expr0 at expr.c:3709 via gfc_done_2 sigurdkn at gmail dot com
                   ` (4 preceding siblings ...)
  2011-08-22 14:27 ` mikael at gcc dot gnu.org
@ 2011-08-22 20:29 ` mikael at gcc dot gnu.org
  2011-08-23 20:10 ` abenson at caltech dot edu
                   ` (11 subsequent siblings)
  17 siblings, 0 replies; 19+ messages in thread
From: mikael at gcc dot gnu.org @ 2011-08-22 20:29 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #6 from Mikael Morin <mikael at gcc dot gnu.org> 2011-08-22 20:03:05 UTC ---
Author: mikael
Date: Mon Aug 22 20:03:00 2011
New Revision: 177970

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=177970
Log:
2011-08-22  Mikael Morin  <mikael.morin@gcc.gnu.org>

    PR fortran/50050
    * gfortran.h (gfc_clear_shape, gfc_free_shape): New prototypes.
    * expr.c (gfc_clear_shape, gfc_free_shape): New functions.
    (free_expr0): Re-use gfc_free_shape.
    * trans-expr.c (gfc_trans_subarray_assign): Ditto.
    * trans-io.c (transfer_array_component): Ditto.
    * resolve.c (check_host_association): Ditto.
    (gfc_expr_to_initialize): Don't force the rank value and free the shape
    after updating the expression. Recalculate shape and rank.
    (resolve_where_shape): Re-use gfc_clear_shape.
    * array.c (gfc_array_ref_shape): Ditto.

2011-08-22  Mikael Morin  <mikael.morin@gcc.gnu.org>

    PR fortran/50050
    * gfortran.dg/alloc_comp_initializer_3.f90: New test.


Added:
   
branches/gcc-4_6-branch/gcc/testsuite/gfortran.dg/alloc_comp_initializer_3.f90
Modified:
    branches/gcc-4_6-branch/gcc/fortran/ChangeLog
    branches/gcc-4_6-branch/gcc/fortran/array.c
    branches/gcc-4_6-branch/gcc/fortran/expr.c
    branches/gcc-4_6-branch/gcc/fortran/gfortran.h
    branches/gcc-4_6-branch/gcc/fortran/resolve.c
    branches/gcc-4_6-branch/gcc/fortran/trans-expr.c
    branches/gcc-4_6-branch/gcc/fortran/trans-io.c
    branches/gcc-4_6-branch/gcc/testsuite/ChangeLog


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

* [Bug fortran/50050] Internal compiler error free_expr0 at expr.c:3709 via gfc_done_2
  2011-08-11 21:50 [Bug fortran/50050] New: Internal compiler error free_expr0 at expr.c:3709 via gfc_done_2 sigurdkn at gmail dot com
                   ` (5 preceding siblings ...)
  2011-08-22 20:29 ` mikael at gcc dot gnu.org
@ 2011-08-23 20:10 ` abenson at caltech dot edu
  2011-08-23 20:13 ` janus at gcc dot gnu.org
                   ` (10 subsequent siblings)
  17 siblings, 0 replies; 19+ messages in thread
From: abenson at caltech dot edu @ 2011-08-23 20:10 UTC (permalink / raw)
  To: gcc-bugs

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

Andrew Benson <abenson at caltech dot edu> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |abenson at caltech dot edu

--- Comment #7 from Andrew Benson <abenson at caltech dot edu> 2011-08-23 19:54:07 UTC ---
The following (reduced from the FoX library m_common_attrs.F90) seems to cause 
an ICE with gfortran 4.7.0 (r177982) - Dominique Dhumieres suggests that this
is probably related to r177970.

module m_common_attrs
  implicit none

  type dict_item
  end type dict_item

  type dict_item_ptr
     type(dict_item), pointer :: d => null()
  end type dict_item_ptr

contains

  subroutine add_item_to_dict()
    type(dict_item_ptr), pointer :: tempList(:)
    integer :: n

    allocate(tempList(0:n+1)) 
  end subroutine add_item_to_dict

end module m_common_attrs

# gfortran -c  test.f90 
f951: internal compiler error: Segmentation fault
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.

# gfortran -v
Using built-in specs.
COLLECT_GCC=gfortran
COLLECT_LTO_WRAPPER=/opt/gcc-trunk/bin/../libexec/gcc/i686-pc-linux-
gnu/4.7.0/lto-wrapper
Target: i686-pc-linux-gnu
Configured with: ../gcc4.7/configure --prefix=/usr/local/gcc-trunk --enable-
languages=c,c++,fortran --disable-multilib --with-gmp=/usr/local --with-
mpc=/usr/local --with-mpfr=/usr/local
Thread model: posix
gcc version 4.7.0 20110823 (experimental) (GCC)


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

* [Bug fortran/50050] Internal compiler error free_expr0 at expr.c:3709 via gfc_done_2
  2011-08-11 21:50 [Bug fortran/50050] New: Internal compiler error free_expr0 at expr.c:3709 via gfc_done_2 sigurdkn at gmail dot com
                   ` (6 preceding siblings ...)
  2011-08-23 20:10 ` abenson at caltech dot edu
@ 2011-08-23 20:13 ` janus at gcc dot gnu.org
  2011-08-23 21:14 ` [Bug fortran/50050] [4.6/4.7 Regression] " burnus at gcc dot gnu.org
                   ` (9 subsequent siblings)
  17 siblings, 0 replies; 19+ messages in thread
From: janus at gcc dot gnu.org @ 2011-08-23 20:13 UTC (permalink / raw)
  To: gcc-bugs

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

janus at gcc dot gnu.org changed:

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

--- Comment #8 from janus at gcc dot gnu.org 2011-08-23 20:10:08 UTC ---
(In reply to comment #7)
> The following (reduced from the FoX library m_common_attrs.F90) seems to cause 
> an ICE with gfortran 4.7.0 (r177982) - Dominique Dhumieres suggests that this
> is probably related to r177970.

... or rather r177956 (the other commit was on the 4.6 branch).

At least it is known to work at r177931 and fails at r177982.


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

* [Bug fortran/50050] [4.6/4.7 Regression] Internal compiler error free_expr0 at expr.c:3709 via gfc_done_2
  2011-08-11 21:50 [Bug fortran/50050] New: Internal compiler error free_expr0 at expr.c:3709 via gfc_done_2 sigurdkn at gmail dot com
                   ` (7 preceding siblings ...)
  2011-08-23 20:13 ` janus at gcc dot gnu.org
@ 2011-08-23 21:14 ` burnus at gcc dot gnu.org
  2011-08-24  6:13 ` jpr at csc dot fi
                   ` (8 subsequent siblings)
  17 siblings, 0 replies; 19+ messages in thread
From: burnus at gcc dot gnu.org @ 2011-08-23 21:14 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |burnus at gcc dot gnu.org
   Target Milestone|---                         |4.6.2
            Summary|Internal compiler error     |[4.6/4.7 Regression]
                   |free_expr0 at expr.c:3709   |Internal compiler error
                   |via gfc_done_2              |free_expr0 at expr.c:3709
                   |                            |via gfc_done_2


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

* [Bug fortran/50050] [4.6/4.7 Regression] Internal compiler error free_expr0 at expr.c:3709 via gfc_done_2
  2011-08-11 21:50 [Bug fortran/50050] New: Internal compiler error free_expr0 at expr.c:3709 via gfc_done_2 sigurdkn at gmail dot com
                   ` (8 preceding siblings ...)
  2011-08-23 21:14 ` [Bug fortran/50050] [4.6/4.7 Regression] " burnus at gcc dot gnu.org
@ 2011-08-24  6:13 ` jpr at csc dot fi
  2011-08-24 17:15 ` jakub at gcc dot gnu.org
                   ` (7 subsequent siblings)
  17 siblings, 0 replies; 19+ messages in thread
From: jpr at csc dot fi @ 2011-08-24  6:13 UTC (permalink / raw)
  To: gcc-bugs

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

jpr at csc dot fi changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jpr at csc dot fi

--- Comment #9 from jpr at csc dot fi 2011-08-24 06:12:58 UTC ---
*** Bug 50173 has been marked as a duplicate of this bug. ***


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

* [Bug fortran/50050] [4.6/4.7 Regression] Internal compiler error free_expr0 at expr.c:3709 via gfc_done_2
  2011-08-11 21:50 [Bug fortran/50050] New: Internal compiler error free_expr0 at expr.c:3709 via gfc_done_2 sigurdkn at gmail dot com
                   ` (9 preceding siblings ...)
  2011-08-24  6:13 ` jpr at csc dot fi
@ 2011-08-24 17:15 ` jakub at gcc dot gnu.org
  2011-08-25  9:18 ` burnus at gcc dot gnu.org
                   ` (6 subsequent siblings)
  17 siblings, 0 replies; 19+ messages in thread
From: jakub at gcc dot gnu.org @ 2011-08-24 17:15 UTC (permalink / raw)
  To: gcc-bugs

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

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

* [Bug fortran/50050] [4.6/4.7 Regression] Internal compiler error free_expr0 at expr.c:3709 via gfc_done_2
  2011-08-11 21:50 [Bug fortran/50050] New: Internal compiler error free_expr0 at expr.c:3709 via gfc_done_2 sigurdkn at gmail dot com
                   ` (10 preceding siblings ...)
  2011-08-24 17:15 ` jakub at gcc dot gnu.org
@ 2011-08-25  9:18 ` burnus at gcc dot gnu.org
  2011-08-25 20:10 ` mikael at gcc dot gnu.org
                   ` (5 subsequent siblings)
  17 siblings, 0 replies; 19+ messages in thread
From: burnus at gcc dot gnu.org @ 2011-08-25  9:18 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |pmason at ricardo dot com

--- Comment #10 from Tobias Burnus <burnus at gcc dot gnu.org> 2011-08-25 09:15:44 UTC ---
*** Bug 50174 has been marked as a duplicate of this bug. ***


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

* [Bug fortran/50050] [4.6/4.7 Regression] Internal compiler error free_expr0 at expr.c:3709 via gfc_done_2
  2011-08-11 21:50 [Bug fortran/50050] New: Internal compiler error free_expr0 at expr.c:3709 via gfc_done_2 sigurdkn at gmail dot com
                   ` (11 preceding siblings ...)
  2011-08-25  9:18 ` burnus at gcc dot gnu.org
@ 2011-08-25 20:10 ` mikael at gcc dot gnu.org
  2011-08-26 22:34 ` mikael at gcc dot gnu.org
                   ` (4 subsequent siblings)
  17 siblings, 0 replies; 19+ messages in thread
From: mikael at gcc dot gnu.org @ 2011-08-25 20:10 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #11 from Mikael Morin <mikael at gcc dot gnu.org> 2011-08-25 19:10:11 UTC ---
Author: mikael
Date: Thu Aug 25 19:10:06 2011
New Revision: 178086

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=178086
Log:
2011-08-25  Mikael Morin  <mikael.morin@gcc.gnu.org>

    PR fortran/50050
    * expr.c (gfc_free_shape): Do nothing if shape is NULL.
    (free_expr0): Remove redundant NULL shape check.
    * resolve.c (check_host_association): Ditto.
    * trans-expr.c (gfc_trans_subarray_assign): Assert that shape is
    non-NULL.
    * trans-io.c (transfer_array_component): Ditto.

2011-08-25  Mikael Morin  <mikael.morin@gcc.gnu.org>

    PR fortran/50050
    * gfortran.dg/pointer_comp_init_1.f90: New test.


Added:
    trunk/gcc/testsuite/gfortran.dg/pointer_comp_init_1.f90
Modified:
    trunk/gcc/fortran/ChangeLog
    trunk/gcc/fortran/expr.c
    trunk/gcc/fortran/resolve.c
    trunk/gcc/fortran/trans-expr.c
    trunk/gcc/fortran/trans-io.c
    trunk/gcc/testsuite/ChangeLog


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

* [Bug fortran/50050] [4.6/4.7 Regression] Internal compiler error free_expr0 at expr.c:3709 via gfc_done_2
  2011-08-11 21:50 [Bug fortran/50050] New: Internal compiler error free_expr0 at expr.c:3709 via gfc_done_2 sigurdkn at gmail dot com
                   ` (12 preceding siblings ...)
  2011-08-25 20:10 ` mikael at gcc dot gnu.org
@ 2011-08-26 22:34 ` mikael at gcc dot gnu.org
  2011-08-30 15:06 ` [Bug fortran/50050] " burnus at gcc dot gnu.org
                   ` (3 subsequent siblings)
  17 siblings, 0 replies; 19+ messages in thread
From: mikael at gcc dot gnu.org @ 2011-08-26 22:34 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #12 from Mikael Morin <mikael at gcc dot gnu.org> 2011-08-26 22:17:13 UTC ---
Author: mikael
Date: Fri Aug 26 22:17:09 2011
New Revision: 178125

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=178125
Log:
2011-08-26  Mikael Morin  <mikael.morin@gcc.gnu.org>

    PR fortran/50050
    * expr.c (gfc_free_shape): Do nothing if shape is NULL.
    (free_expr0): Remove redundant NULL shape check.
    * resolve.c (check_host_association): Ditto.
    * trans-expr.c (gfc_trans_subarray_assign): Assert that shape is
    non-NULL.
    * trans-io.c (transfer_array_component): Ditto.

2011-08-26  Mikael Morin  <mikael.morin@gcc.gnu.org>

    PR fortran/50050
    * gfortran.dg/pointer_comp_init_1.f90: New test.


Added:
    branches/gcc-4_6-branch/gcc/testsuite/gfortran.dg/pointer_comp_init_1.f90
Modified:
    branches/gcc-4_6-branch/gcc/fortran/ChangeLog
    branches/gcc-4_6-branch/gcc/fortran/expr.c
    branches/gcc-4_6-branch/gcc/fortran/resolve.c
    branches/gcc-4_6-branch/gcc/fortran/trans-expr.c
    branches/gcc-4_6-branch/gcc/fortran/trans-io.c
    branches/gcc-4_6-branch/gcc/testsuite/ChangeLog


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

* [Bug fortran/50050] Internal compiler error free_expr0 at expr.c:3709 via gfc_done_2
  2011-08-11 21:50 [Bug fortran/50050] New: Internal compiler error free_expr0 at expr.c:3709 via gfc_done_2 sigurdkn at gmail dot com
                   ` (13 preceding siblings ...)
  2011-08-26 22:34 ` mikael at gcc dot gnu.org
@ 2011-08-30 15:06 ` burnus at gcc dot gnu.org
  2011-09-01 15:54 ` mikael at gcc dot gnu.org
                   ` (2 subsequent siblings)
  17 siblings, 0 replies; 19+ messages in thread
From: burnus at gcc dot gnu.org @ 2011-08-30 15:06 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|[4.6/4.7 Regression]        |Internal compiler error
                   |Internal compiler error     |free_expr0 at expr.c:3709
                   |free_expr0 at expr.c:3709   |via gfc_done_2
                   |via gfc_done_2              |

--- Comment #13 from Tobias Burnus <burnus at gcc dot gnu.org> 2011-08-30 14:43:20 UTC ---
I removed the regression marker as the regression (cf. comment 7 to comment 12)
has been fixed for the affected 4.6 branch and the 4.7 trunk.

I leave the PR open in case someone wants to backport (to 4.5 and/or 4.4) the
original patch (comment 5) with the follow-up patch (comment 11). The original
bug is about an ice-on-valid-code issue.


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

* [Bug fortran/50050] Internal compiler error free_expr0 at expr.c:3709 via gfc_done_2
  2011-08-11 21:50 [Bug fortran/50050] New: Internal compiler error free_expr0 at expr.c:3709 via gfc_done_2 sigurdkn at gmail dot com
                   ` (14 preceding siblings ...)
  2011-08-30 15:06 ` [Bug fortran/50050] " burnus at gcc dot gnu.org
@ 2011-09-01 15:54 ` mikael at gcc dot gnu.org
  2011-09-01 19:20 ` mikael at gcc dot gnu.org
  2011-09-01 19:46 ` mikael at gcc dot gnu.org
  17 siblings, 0 replies; 19+ messages in thread
From: mikael at gcc dot gnu.org @ 2011-09-01 15:54 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #14 from Mikael Morin <mikael at gcc dot gnu.org> 2011-09-01 15:52:42 UTC ---
Author: mikael
Date: Thu Sep  1 15:52:39 2011
New Revision: 178424

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=178424
Log:
2011-09-01  Mikael Morin  <mikael.morin@sfr.fr>

    PR fortran/50050
    * resolve.c (gfc_expr_to_initialize): Don't copy rank.
    Free copied shape.  Recalculate shape and rank.

2011-09-01  Mikael Morin  <mikael.morin@sfr.fr>

    PR fortran/50050
    * gfortran.dg/alloc_comp_initializer_3.f90: New test.
    * gfortran.dg/pointer_comp_init.f90: New test.


Added:
   
branches/gcc-4_5-branch/gcc/testsuite/gfortran.dg/alloc_comp_initializer_3.f90
    branches/gcc-4_5-branch/gcc/testsuite/gfortran.dg/pointer_comp_init_1.f90
Modified:
    branches/gcc-4_5-branch/gcc/fortran/ChangeLog
    branches/gcc-4_5-branch/gcc/fortran/resolve.c
    branches/gcc-4_5-branch/gcc/testsuite/ChangeLog


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

* [Bug fortran/50050] Internal compiler error free_expr0 at expr.c:3709 via gfc_done_2
  2011-08-11 21:50 [Bug fortran/50050] New: Internal compiler error free_expr0 at expr.c:3709 via gfc_done_2 sigurdkn at gmail dot com
                   ` (15 preceding siblings ...)
  2011-09-01 15:54 ` mikael at gcc dot gnu.org
@ 2011-09-01 19:20 ` mikael at gcc dot gnu.org
  2011-09-01 19:46 ` mikael at gcc dot gnu.org
  17 siblings, 0 replies; 19+ messages in thread
From: mikael at gcc dot gnu.org @ 2011-09-01 19:20 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #15 from Mikael Morin <mikael at gcc dot gnu.org> 2011-09-01 19:20:05 UTC ---
Author: mikael
Date: Thu Sep  1 19:19:55 2011
New Revision: 178427

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=178427
Log:
2011-09-01  Mikael Morin  <mikael.morin@sfr.fr>

    PR fortran/50050
    * resolve.c (gfc_expr_to_initialize): Don't copy rank.
    Free copied shape.  Recalculate shape and rank.

2011-09-01  Mikael Morin  <mikael.morin@sfr.fr>

    PR fortran/50050
    * gfortran.dg/alloc_comp_initializer_3.f90: New test.
    * gfortran.dg/pointer_comp_init.f90: New test.


Added:
   
branches/gcc-4_4-branch/gcc/testsuite/gfortran.dg/alloc_comp_initializer_3.f90
    branches/gcc-4_4-branch/gcc/testsuite/gfortran.dg/pointer_comp_init_1.f90
Modified:
    branches/gcc-4_4-branch/gcc/fortran/ChangeLog
    branches/gcc-4_4-branch/gcc/fortran/resolve.c
    branches/gcc-4_4-branch/gcc/testsuite/ChangeLog


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

* [Bug fortran/50050] Internal compiler error free_expr0 at expr.c:3709 via gfc_done_2
  2011-08-11 21:50 [Bug fortran/50050] New: Internal compiler error free_expr0 at expr.c:3709 via gfc_done_2 sigurdkn at gmail dot com
                   ` (16 preceding siblings ...)
  2011-09-01 19:20 ` mikael at gcc dot gnu.org
@ 2011-09-01 19:46 ` mikael at gcc dot gnu.org
  17 siblings, 0 replies; 19+ messages in thread
From: mikael at gcc dot gnu.org @ 2011-09-01 19:46 UTC (permalink / raw)
  To: gcc-bugs

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

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

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

--- Comment #16 from Mikael Morin <mikael at gcc dot gnu.org> 2011-09-01 19:45:11 UTC ---
Fixed for 4.4.7, 4.5.4, 4.6.2 and 4.7.0.
Thanks for the report.


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

end of thread, other threads:[~2011-09-01 19:46 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-08-11 21:50 [Bug fortran/50050] New: Internal compiler error free_expr0 at expr.c:3709 via gfc_done_2 sigurdkn at gmail dot com
2011-08-12 11:45 ` [Bug fortran/50050] " mikael at gcc dot gnu.org
2011-08-12 12:19 ` mikael at gcc dot gnu.org
2011-08-12 12:47 ` mikael at gcc dot gnu.org
2011-08-20 14:55 ` mikael at gcc dot gnu.org
2011-08-22 14:27 ` mikael at gcc dot gnu.org
2011-08-22 20:29 ` mikael at gcc dot gnu.org
2011-08-23 20:10 ` abenson at caltech dot edu
2011-08-23 20:13 ` janus at gcc dot gnu.org
2011-08-23 21:14 ` [Bug fortran/50050] [4.6/4.7 Regression] " burnus at gcc dot gnu.org
2011-08-24  6:13 ` jpr at csc dot fi
2011-08-24 17:15 ` jakub at gcc dot gnu.org
2011-08-25  9:18 ` burnus at gcc dot gnu.org
2011-08-25 20:10 ` mikael at gcc dot gnu.org
2011-08-26 22:34 ` mikael at gcc dot gnu.org
2011-08-30 15:06 ` [Bug fortran/50050] " burnus at gcc dot gnu.org
2011-09-01 15:54 ` mikael at gcc dot gnu.org
2011-09-01 19:20 ` mikael at gcc dot gnu.org
2011-09-01 19:46 ` 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).