public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/65024] New: Internal compiler error (gfortran) concerning unlimited polymorphic pointer
@ 2015-02-11 18:02 matt at gneilson dot plus.com
  2015-02-11 18:05 ` [Bug fortran/65024] " dominiq at lps dot ens.fr
                   ` (14 more replies)
  0 siblings, 15 replies; 16+ messages in thread
From: matt at gneilson dot plus.com @ 2015-02-11 18:02 UTC (permalink / raw)
  To: gcc-bugs

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset="UTF-8", Size: 6477 bytes --]

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

            Bug ID: 65024
           Summary: Internal compiler error (gfortran) concerning
                    unlimited polymorphic pointer
           Product: gcc
           Version: 4.9.2
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
          Assignee: unassigned at gcc dot gnu.org
          Reporter: matt at gneilson dot plus.com

Created attachment 34732
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=34732&action=edit
Sample program that produces the referenced internal compiler error.

As explained in the GNU Fortran mailing list (see
http://gcc.gnu.org/ml/fortran/2015-02/msg00047.html ).

Please find attached some annotated sample code ('test.f90') that produces the
error in question. The compiler seems to have trouble with the subroutine that
I've named 'BUG' (lines 37-50); more specifically, the compiler appears to be
complaining about line 48 (which I have labelled line "C"). The 'BUG'
subroutine calls the subroutine named 'NEXT' to associate the 'e' pointer with
a piece of preallocated memory, and then points the unlimited polymorphic
'e%info' variable to the piece of memory associated with the pointer 'p'.
Attempting to compile the code as-is produces the following output:

### Beginning of Terminal output ###

matt$ gfortran -v -save-temps -o test test.f90 
Driving: gfortran -mmacosx-version-min=10.10.1 -v -save-temps -o test test.f90
-l gfortran -shared-libgcc
Using built-in specs.
COLLECT_GCC=gfortran
COLLECT_LTO_WRAPPER=/usr/local/libexec/gcc/x86_64-apple-darwin14.0.0/4.9.2/lto-wrapper
Target: x86_64-apple-darwin14.0.0
Configured with: ../gcc-4.9-20141029/configure --enable-languages=c++,fortran
Thread model: posix
gcc version 4.9.2 20141029 (prerelease) (GCC) 
COLLECT_GCC_OPTIONS='-mmacosx-version-min=10.10.1' '-v' '-save-temps' '-o'
'test' '-shared-libgcc' '-mtune=core2'
 /usr/local/libexec/gcc/x86_64-apple-darwin14.0.0/4.9.2/f951 test.f90 -fPIC
-quiet -dumpbase test.f90 -mmacosx-version-min=10.10.1 -mtune=core2 -auxbase
test -version -fintrinsic-modules-path
/usr/local/lib/gcc/x86_64-apple-darwin14.0.0/4.9.2/finclude -o test.s
GNU Fortran (GCC) version 4.9.2 20141029 (prerelease)
(x86_64-apple-darwin14.0.0)
    compiled by GNU C version 4.9.2 20141029 (prerelease), GMP version 6.0.0,
MPFR version 3.1.2-p10, MPC version 1.0.2
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
GNU Fortran (GCC) version 4.9.2 20141029 (prerelease)
(x86_64-apple-darwin14.0.0)
    compiled by GNU C version 4.9.2 20141029 (prerelease), GMP version 6.0.0,
MPFR version 3.1.2-p10, MPC version 1.0.2
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
test.f90: In function ‘bug’:
test.f90:48:0: internal compiler error: in gfc_conv_component_ref, at
fortran/trans-expr.c:1660
       e%info => p      ! line "C"
 ^

test.f90:48:0: internal compiler error: Abort trap: 6
gfortran: internal compiler error: Abort trap: 6 (program f951)
Abort trap: 6

### End of Terminal output ###

Oddly enough, the code compiles without error if I comment-out the call to
'NEXT' (line 42, which I've labelled line "A") and uncomment lines 43-45 (which
I've labelled lines "B_1", "B_2", and "B_3"), even though the 'NEXT' subroutine
contains *exactly* the same content as lines 43-45.

Andre Vehreschild responded to my post on the GNU Fortran mailing list, and he
recommended that I add the following information:

"When translating the pointer assignment in the select type the backend_decl of
the _vptr's component-ref is not initialized (== NULL), leading to the crash
experienced here. I haven't encountered something similar yet, therefore I can
only guess: Something going wrong in the resolve-stage?"
>From gcc-bugs-return-476900-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Wed Feb 11 18:03:20 2015
Return-Path: <gcc-bugs-return-476900-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 6559 invoked by alias); 11 Feb 2015 18:03:20 -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 6419 invoked by uid 48); 11 Feb 2015 18:03:15 -0000
From: "fkrogh#gcc at mathalacarte dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug fortran/65025] New: Internal compiler error with preprocessor in gfortran
Date: Wed, 11 Feb 2015 18:03:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: new
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: fortran
X-Bugzilla-Version: 4.9.2
X-Bugzilla-Keywords:
X-Bugzilla-Severity: normal
X-Bugzilla-Who: fkrogh#gcc at mathalacarte dot com
X-Bugzilla-Status: UNCONFIRMED
X-Bugzilla-Priority: P3
X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org
X-Bugzilla-Target-Milestone: ---
X-Bugzilla-Flags:
X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter attachments.created
Message-ID: <bug-65025-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: 2015-02/txt/msg01233.txt.bz2
Content-length: 783

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

            Bug ID: 65025
           Summary: Internal compiler error with preprocessor in gfortran
           Product: gcc
           Version: 4.9.2
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
          Assignee: unassigned at gcc dot gnu.org
          Reporter: fkrogh#gcc at mathalacarte dot com

Created attachment 34733
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id4733&actioníit
Short program that gives the internal compiler error

Compile the attached with

gfortran -Dplet_=\'d\' -g -o test test.F90

or replace the d with s, q, or nonsense.  The kind of preprocessor code used
here seems to be handled just fine in the case of C code for gcc.


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

end of thread, other threads:[~2015-03-15  9:23 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-02-11 18:02 [Bug fortran/65024] New: Internal compiler error (gfortran) concerning unlimited polymorphic pointer matt at gneilson dot plus.com
2015-02-11 18:05 ` [Bug fortran/65024] " dominiq at lps dot ens.fr
2015-02-11 20:14 ` [Bug fortran/65024] [4.9/5 Regression] [OOP] ICE " janus at gcc dot gnu.org
2015-02-11 21:28 ` matt at gneilson dot plus.com
2015-02-15 14:37 ` dominiq at lps dot ens.fr
2015-02-15 23:02 ` dominiq at lps dot ens.fr
2015-02-16  8:56 ` janus at gcc dot gnu.org
2015-02-16 12:40 ` matt at gneilson dot plus.com
2015-02-16 15:00 ` dominiq at lps dot ens.fr
2015-02-16 15:19 ` matt at gneilson dot plus.com
2015-02-16 18:53 ` pault at gcc dot gnu.org
2015-03-09 14:42 ` rguenth at gcc dot gnu.org
2015-03-10 19:39 ` pault at gcc dot gnu.org
2015-03-10 22:24 ` pault at gcc dot gnu.org
2015-03-15  9:13 ` pault at gcc dot gnu.org
2015-03-15  9:23 ` [Bug fortran/65024] [OOP] unlimited polymorphic pointer structure not built when it should be 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).