public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/64229] New: internal compiler error when assigning allocatable arrays of character(:)
@ 2014-12-08 19:12 ondrej.certik at gmail dot com
  2014-12-08 23:22 ` [Bug fortran/64229] " dominiq at lps dot ens.fr
  0 siblings, 1 reply; 2+ messages in thread
From: ondrej.certik at gmail dot com @ 2014-12-08 19:12 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64229

            Bug ID: 64229
           Summary: internal compiler error when assigning allocatable
                    arrays of character(:)
           Product: gcc
           Version: 4.9.2
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
          Assignee: unassigned at gcc dot gnu.org
          Reporter: ondrej.certik at gmail dot com

Created attachment 34223
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=34223&action=edit
Test program to trigger ICE

The following code (also attached):

$ cat test_ice.f90 
program test_ice
character(:), allocatable :: x(:), y(:)
x = y
end

Produces an ICE:

$ gfortran -v test_ice.f90 
Driving: gfortran -v test_ice.f90 -l gfortran -l m -shared-libgcc
Using built-in specs.
COLLECT_GCC=gfortran
COLLECT_LTO_WRAPPER=/local/certik/bld/gcc/zzcagdji4y4w/libexec/gcc/x86_64-unknown-linux-gnu/4.9.2/lto-wrapper
Target: x86_64-unknown-linux-gnu
Configured with: ./configure --prefix=/local/certik/bld/gcc/zzcagdji4y4w
--enable-checking=release --enable-languages=fortran,c,c++
--with-local-prefix=/local/certik/bld/gcc/zzcagdji4y4w
--with-gmp=/local/certik/bld/gmp/vadkrj43wtyr
--with-mpc=/local/certik/bld/mpc/sushaq7ufe2f
--with-mpfr=/local/certik/bld/mpfr/vxwmnxjsshse
--with-cloog=/local/certik/bld/cloog/f5p5vql5p36v
--with-isl=/local/certik/bld/isl/qr4j7jaetze7 --enable-clocale=gnu
--enable-__cxa_atexit --enable-shared --enable-threads=posix --disable-multilib
--libdir=/local/certik/bld/gcc/zzcagdji4y4w/lib
--with-stage1-ldflags='-L/local/certik/bld/cloog/f5p5vql5p36v/lib
-Wl,-rpath=/local/certik/bld/cloog/f5p5vql5p36v/lib
-L/local/certik/bld/gmp/vadkrj43wtyr/lib
-Wl,-rpath=/local/certik/bld/gmp/vadkrj43wtyr/lib
-L/local/certik/bld/isl/qr4j7jaetze7/lib
-Wl,-rpath=/local/certik/bld/isl/qr4j7jaetze7/lib
-L/local/certik/bld/mpc/sushaq7ufe2f/lib
-Wl,-rpath=/local/certik/bld/mpc/sushaq7ufe2f/lib
-L/local/certik/bld/mpfr/vxwmnxjsshse/lib
-Wl,-rpath=/local/certik/bld/mpfr/vxwmnxjsshse/lib
-L/local/certik/bld/patchelf/k3rloj265ogt/lib
-Wl,-rpath=/local/certik/bld/patchelf/k3rloj265ogt/lib
-L/local/certik/bld/zlib/3el5ccejre7b/lib
-Wl,-rpath=/local/certik/bld/zlib/3el5ccejre7b/lib'
--with-boot-ldflags='-L/local/certik/bld/cloog/f5p5vql5p36v/lib
-Wl,-rpath=/local/certik/bld/cloog/f5p5vql5p36v/lib
-L/local/certik/bld/gmp/vadkrj43wtyr/lib
-Wl,-rpath=/local/certik/bld/gmp/vadkrj43wtyr/lib
-L/local/certik/bld/isl/qr4j7jaetze7/lib
-Wl,-rpath=/local/certik/bld/isl/qr4j7jaetze7/lib
-L/local/certik/bld/mpc/sushaq7ufe2f/lib
-Wl,-rpath=/local/certik/bld/mpc/sushaq7ufe2f/lib
-L/local/certik/bld/mpfr/vxwmnxjsshse/lib
-Wl,-rpath=/local/certik/bld/mpfr/vxwmnxjsshse/lib
-L/local/certik/bld/patchelf/k3rloj265ogt/lib
-Wl,-rpath=/local/certik/bld/patchelf/k3rloj265ogt/lib
-L/local/certik/bld/zlib/3el5ccejre7b/lib
-Wl,-rpath=/local/certik/bld/zlib/3el5ccejre7b/lib'
Thread model: posix
gcc version 4.9.2 (GCC) 
COLLECT_GCC_OPTIONS='-v' '-shared-libgcc' '-mtune=generic' '-march=x86-64'

/local/certik/bld/gcc/zzcagdji4y4w/libexec/gcc/x86_64-unknown-linux-gnu/4.9.2/f951
test_ice.f90 -quiet -dumpbase test_ice.f90 -mtune=generic -march=x86-64
-auxbase test_ice -version -fintrinsic-modules-path
/local/certik/bld/gcc/zzcagdji4y4w/lib/gcc/x86_64-unknown-linux-gnu/4.9.2/finclude
-o /tmp/ccQyibte.s
GNU Fortran (GCC) version 4.9.2 (x86_64-unknown-linux-gnu)
    compiled by GNU C version 4.9.2, GMP version 5.1.3, MPFR version 3.1.2, MPC
version 1.0.2
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
GNU Fortran (GCC) version 4.9.2 (x86_64-unknown-linux-gnu)
    compiled by GNU C version 4.9.2, GMP version 5.1.3, MPFR version 3.1.2, MPC
version 1.0.2
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
test_ice.f90: In function ‘test_ice’:
test_ice.f90:3:0: internal compiler error: in gimplify_var_or_parm_decl, at
gimplify.c:1741
 x = y
 ^
0x79b5dd gimplify_var_or_parm_decl
    ../.././gcc/gimplify.c:1741
0x79f9d7 gimplify_expr(tree_node**, gimple_statement_base**,
gimple_statement_base**, bool (*)(tree_node*), int)
    ../.././gcc/gimplify.c:8058
0x79d089 gimplify_modify_expr
    ../.././gcc/gimplify.c:4510
0x79f2c7 gimplify_expr(tree_node**, gimple_statement_base**,
gimple_statement_base**, bool (*)(tree_node*), int)
    ../.././gcc/gimplify.c:7627
0x7a0ce6 gimplify_stmt(tree_node**, gimple_statement_base**)
    ../.././gcc/gimplify.c:5373
0x79f793 gimplify_statement_list
    ../.././gcc/gimplify.c:1432
0x79f793 gimplify_expr(tree_node**, gimple_statement_base**,
gimple_statement_base**, bool (*)(tree_node*), int)
    ../.././gcc/gimplify.c:8042
0x7a0ce6 gimplify_stmt(tree_node**, gimple_statement_base**)
    ../.././gcc/gimplify.c:5373
0x7a157b gimplify_bind_expr
    ../.././gcc/gimplify.c:1099
0x79eaee gimplify_expr(tree_node**, gimple_statement_base**,
gimple_statement_base**, bool (*)(tree_node*), int)
    ../.././gcc/gimplify.c:7824
0x7a0ce6 gimplify_stmt(tree_node**, gimple_statement_base**)
    ../.././gcc/gimplify.c:5373
0x79f793 gimplify_statement_list
    ../.././gcc/gimplify.c:1432
0x79f793 gimplify_expr(tree_node**, gimple_statement_base**,
gimple_statement_base**, bool (*)(tree_node*), int)
    ../.././gcc/gimplify.c:8042
0x7a0ce6 gimplify_stmt(tree_node**, gimple_statement_base**)
    ../.././gcc/gimplify.c:5373
0x7a157b gimplify_bind_expr
    ../.././gcc/gimplify.c:1099
0x79eaee gimplify_expr(tree_node**, gimple_statement_base**,
gimple_statement_base**, bool (*)(tree_node*), int)
    ../.././gcc/gimplify.c:7824
0x7a0ce6 gimplify_stmt(tree_node**, gimple_statement_base**)
    ../.././gcc/gimplify.c:5373
0x7a1b9a gimplify_body(tree_node*, bool)
    ../.././gcc/gimplify.c:8734
0x7a1e87 gimplify_function_tree(tree_node*)
    ../.././gcc/gimplify.c:8887
0x69caf7 cgraph_analyze_function(cgraph_node*)
    ../.././gcc/cgraphunit.c:648
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.



This seems to be caused by the same bug as in
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=62142, because this compiles:

$ gfortran -fno-realloc-lhs test_ice.f90
$

and gfortran 4.7.2 also compiles:

$ gfortran test_ice.f90 
$

So probably the fix in #62142 didn't fix all the cases. 


The above test case is the minimal example that still triggers the compiler
error. The actual code where I discovered this problem is:

  type, extends(parameter_entry), public :: any_matrix
    private
    class(*), allocatable :: value(:,:)
    ...
  end

  subroutine get_matrix_character (this, value, errc)
    class(any_matrix), intent(in) :: this
    character(:), allocatable, intent(out) :: value(:,:)
    logical, intent(out) :: errc
    select type (v => this%value)
    type is (character(*))
      value = v
      errc = .false.
    class default
      errc = .true.
    end select
  end subroutine

It works with PGI and Intel.
>From gcc-bugs-return-469799-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Mon Dec 08 19:32:29 2014
Return-Path: <gcc-bugs-return-469799-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 23686 invoked by alias); 8 Dec 2014 19:32:28 -0000
Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm
Precedence: bulk
List-Id: <gcc-bugs.gcc.gnu.org>
List-Archive: <http://gcc.gnu.org/ml/gcc-bugs/>
List-Post: <mailto:gcc-bugs@gcc.gnu.org>
List-Help: <mailto:gcc-bugs-help@gcc.gnu.org>
Sender: gcc-bugs-owner@gcc.gnu.org
Delivered-To: mailing list gcc-bugs@gcc.gnu.org
Received: (qmail 23664 invoked by uid 55); 8 Dec 2014 19:32:22 -0000
From: "dmalcolm at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug jit/63854] Fix memory leaks seen in JIT
Date: Mon, 08 Dec 2014 19:32:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: jit
X-Bugzilla-Version: 5.0
X-Bugzilla-Keywords:
X-Bugzilla-Severity: normal
X-Bugzilla-Who: dmalcolm at gcc dot gnu.org
X-Bugzilla-Status: ASSIGNED
X-Bugzilla-Priority: P3
X-Bugzilla-Assigned-To: dmalcolm at gcc dot gnu.org
X-Bugzilla-Target-Milestone: ---
X-Bugzilla-Flags:
X-Bugzilla-Changed-Fields:
Message-ID: <bug-63854-4-4petVT8MLQ@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-63854-4@http.gcc.gnu.org/bugzilla/>
References: <bug-63854-4@http.gcc.gnu.org/bugzilla/>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 7bit
X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/
Auto-Submitted: auto-generated
MIME-Version: 1.0
X-SW-Source: 2014-12/txt/msg00806.txt.bz2
Content-length: 1584

https://gcc.gnu.org/bugzilla/show_bug.cgi?idc854

--- Comment #27 from David Malcolm <dmalcolm at gcc dot gnu.org> ---
Author: dmalcolm
Date: Mon Dec  8 19:31:45 2014
New Revision: 218490

URL: https://gcc.gnu.org/viewcvs?rev!8490&root=gcc&view=rev
Log:
PR jit/63854: Introduce xstrdup_for_dump

gcc/ChangeLog:
    PR jit/63854
    * cgraph.h (xstrdup_for_dump): New function.
    * cgraph.c (cgraph_node::get_create): Replace use of xstrdup
    within fprintf with xstrdup_for_dump.
    (cgraph_edge::make_speculative): Likewise.
    (cgraph_edge::resolve_speculation): Likewise.
    (cgraph_edge::redirect_call_stmt_to_callee): Likewise.
    (cgraph_node::dump): Likewise.
    * cgraphclones.c (symbol_table::materialize_all_clones): Likewise.
    * ipa-cp.c (perhaps_add_new_callers): Likewise.
    * ipa-inline.c (report_inline_failed_reason): Likewise.
    (want_early_inline_function_p): Likewise.
    (edge_badness): Likewise.
    (update_edge_key): Likewise.
    (flatten_function): Likewise.
    (inline_always_inline_functions): Likewise.
    * ipa-profile.c (ipa_profile): Likewise.
    * ipa-prop.c (ipa_print_node_jump_functions): Likewise.
    (ipa_make_edge_direct_to_target): Likewise.
    (remove_described_reference): Likewise.
    (propagate_controlled_uses): Likewise.
    * ipa-utils.c (ipa_merge_profiles): Likewise.


Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/cgraph.c
    trunk/gcc/cgraph.h
    trunk/gcc/cgraphclones.c
    trunk/gcc/ipa-cp.c
    trunk/gcc/ipa-inline.c
    trunk/gcc/ipa-profile.c
    trunk/gcc/ipa-prop.c
    trunk/gcc/ipa-utils.c


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

* [Bug fortran/64229] internal compiler error when assigning allocatable arrays of character(:)
  2014-12-08 19:12 [Bug fortran/64229] New: internal compiler error when assigning allocatable arrays of character(:) ondrej.certik at gmail dot com
@ 2014-12-08 23:22 ` dominiq at lps dot ens.fr
  0 siblings, 0 replies; 2+ messages in thread
From: dominiq at lps dot ens.fr @ 2014-12-08 23:22 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64229

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

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

--- Comment #1 from Dominique d'Humieres <dominiq at lps dot ens.fr> ---
Dup.

*** This bug has been marked as a duplicate of bug 54070 ***


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

end of thread, other threads:[~2014-12-08 23:22 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-12-08 19:12 [Bug fortran/64229] New: internal compiler error when assigning allocatable arrays of character(:) ondrej.certik at gmail dot com
2014-12-08 23:22 ` [Bug fortran/64229] " dominiq at lps dot ens.fr

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).