public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/64757] New: internal compiler error: in fold_convert_loc, at fold-const.c:2353
@ 2015-01-23 22:34 mike at rilee dot net
2015-01-24 11:52 ` [Bug fortran/64757] " dominiq at lps dot ens.fr
` (12 more replies)
0 siblings, 13 replies; 14+ messages in thread
From: mike at rilee dot net @ 2015-01-23 22:34 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64757
Bug ID: 64757
Summary: internal compiler error: in fold_convert_loc, at
fold-const.c:2353
Product: gcc
Version: 5.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: fortran
Assignee: unassigned at gcc dot gnu.org
Reporter: mike at rilee dot net
Created attachment 34557
--> https://gcc.gnu.org/bugzilla/attachment.cgi?id=34557&action=edit
Internal compiler error driver for fold_convert_loc at fold-const.c:2353
The following yields an internal compiler error. Driver attached with complete
information.
type(Test) :: aTest
type(TestReference), allocatable :: testList(:)
testList = [TestReference(aTest)]
The error:
! testList = [TestReference(aTest)]
! 1
! internal compiler error: in fold_convert_loc, at fold-const.c:2353
!
! t00.F90:27:0: internal compiler error: Abort trap: 6
! gfortran-mp-5: internal compiler error: Abort trap: 6 (program f951)
! Abort trap: 6
The system: gfortran-mp-5
bash-3.2$ uname -a
! Darwin rstllc5 13.4.0 Darwin Kernel Version 13.4.0: Sun Aug 17 19:50:11 PDT
2014; root:xnu-2422.115.4~1/RELEASE_X86_64 x86_64
! bash-3.2$ ${FC} --version
! GNU Fortran (MacPorts gcc5 5-20150118_0) 5.0.0 20150118 (experimental)
! [...]
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug fortran/64757] internal compiler error: in fold_convert_loc, at fold-const.c:2353
2015-01-23 22:34 [Bug fortran/64757] New: internal compiler error: in fold_convert_loc, at fold-const.c:2353 mike at rilee dot net
@ 2015-01-24 11:52 ` dominiq at lps dot ens.fr
2015-01-24 12:20 ` janus at gcc dot gnu.org
` (11 subsequent siblings)
12 siblings, 0 replies; 14+ messages in thread
From: dominiq at lps dot ens.fr @ 2015-01-24 11:52 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64757
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> ---
I get the same ICE with the change to
...
type(TestReference), allocatable :: testList!(:)
...
testList = TestReference(aTest)
...
Thus I think it is a duplicate of pr49213.
*** This bug has been marked as a duplicate of bug 49213 ***
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug fortran/64757] internal compiler error: in fold_convert_loc, at fold-const.c:2353
2015-01-23 22:34 [Bug fortran/64757] New: internal compiler error: in fold_convert_loc, at fold-const.c:2353 mike at rilee dot net
2015-01-24 11:52 ` [Bug fortran/64757] " dominiq at lps dot ens.fr
@ 2015-01-24 12:20 ` janus at gcc dot gnu.org
2015-01-24 12:24 ` [Bug fortran/64757] [5 Regression] ICE " janus at gcc dot gnu.org
` (10 subsequent siblings)
12 siblings, 0 replies; 14+ messages in thread
From: janus at gcc dot gnu.org @ 2015-01-24 12:20 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64757
janus at gcc dot gnu.org changed:
What |Removed |Added
----------------------------------------------------------------------------
Keywords| |ice-on-valid-code
Status|RESOLVED |NEW
Last reconfirmed| |2015-01-24
CC| |janus at gcc dot gnu.org
Resolution|DUPLICATE |---
Ever confirmed|0 |1
--- Comment #2 from janus at gcc dot gnu.org ---
(In reply to Dominique d'Humieres from comment #1
> Thus I think it is a duplicate of pr49213.
It it certainly related, but I'm not sure it is an exact duplicate. In
particular the above PR has quite a history and includes several test cases.
Let's keep it separate for now.
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug fortran/64757] [5 Regression] ICE in fold_convert_loc, at fold-const.c:2353
2015-01-23 22:34 [Bug fortran/64757] New: internal compiler error: in fold_convert_loc, at fold-const.c:2353 mike at rilee dot net
2015-01-24 11:52 ` [Bug fortran/64757] " dominiq at lps dot ens.fr
2015-01-24 12:20 ` janus at gcc dot gnu.org
@ 2015-01-24 12:24 ` janus at gcc dot gnu.org
2015-01-24 12:31 ` dominiq at lps dot ens.fr
` (9 subsequent siblings)
12 siblings, 0 replies; 14+ messages in thread
From: janus at gcc dot gnu.org @ 2015-01-24 12:24 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64757
janus at gcc dot gnu.org changed:
What |Removed |Added
----------------------------------------------------------------------------
Summary|internal compiler error: in |[5 Regression] ICE in
|fold_convert_loc, at |fold_convert_loc, at
|fold-const.c:2353 |fold-const.c:2353
--- Comment #3 from janus at gcc dot gnu.org ---
Here is a reduction of the original test case which gives the ICE with trunk,
but compiles cleanly with 4.9:
type :: Test
end type
type :: TestReference
class(Test), allocatable :: test
end type
type(TestReference) :: testList
testList = TestReference(Test()) ! ICE in fold_convert_loc
end
The backtrace is:
internal compiler error: in fold_convert_loc, bei fold-const.c:2357
0x814255 fold_convert_loc(unsigned int, tree_node*, tree_node*)
/home/jweil/gcc/gcc50/trunk/gcc/fold-const.c:2357
0x6b16ea alloc_scalar_allocatable_for_subcomponent_assignment
/home/jweil/gcc/gcc50/trunk/gcc/fortran/trans-expr.c:6403
0x6b16ea gfc_trans_subcomponent_assign
/home/jweil/gcc/gcc50/trunk/gcc/fortran/trans-expr.c:6497
0x6b087b gfc_trans_structure_assign
/home/jweil/gcc/gcc50/trunk/gcc/fortran/trans-expr.c:6649
0x6b2104 gfc_conv_structure(gfc_se*, gfc_expr*, int)
/home/jweil/gcc/gcc50/trunk/gcc/fortran/trans-expr.c:6678
0x6ad46c gfc_conv_expr(gfc_se*, gfc_expr*)
/home/jweil/gcc/gcc50/trunk/gcc/fortran/trans-expr.c:6848
0x6b32ff gfc_trans_assignment_1
/home/jweil/gcc/gcc50/trunk/gcc/fortran/trans-expr.c:8553
0x682035 trans_code
/home/jweil/gcc/gcc50/trunk/gcc/fortran/trans.c:1650
0x6a2e53 gfc_generate_function_code(gfc_namespace*)
/home/jweil/gcc/gcc50/trunk/gcc/fortran/trans-decl.c:5844
0x63e470 translate_all_program_units
/home/jweil/gcc/gcc50/trunk/gcc/fortran/parse.c:5341
0x63e470 gfc_parse_file()
/home/jweil/gcc/gcc50/trunk/gcc/fortran/parse.c:5538
0x67de95 gfc_be_parse_file
/home/jweil/gcc/gcc50/trunk/gcc/fortran/f95-lang.c:228
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug fortran/64757] [5 Regression] ICE in fold_convert_loc, at fold-const.c:2353
2015-01-23 22:34 [Bug fortran/64757] New: internal compiler error: in fold_convert_loc, at fold-const.c:2353 mike at rilee dot net
` (2 preceding siblings ...)
2015-01-24 12:24 ` [Bug fortran/64757] [5 Regression] ICE " janus at gcc dot gnu.org
@ 2015-01-24 12:31 ` dominiq at lps dot ens.fr
2015-01-24 12:35 ` janus at gcc dot gnu.org
` (8 subsequent siblings)
12 siblings, 0 replies; 14+ messages in thread
From: dominiq at lps dot ens.fr @ 2015-01-24 12:31 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64757
--- Comment #4 from Dominique d'Humieres <dominiq at lps dot ens.fr> ---
> It it certainly related, but I'm not sure it is an exact duplicate.
> In particular the above PR has quite a history and includes several
> test cases. Let's keep it separate for now.
I disagree. AFACT this PR gives the same ICE as the test in pr49213 comment 8
or the following variant of the original code
program main
type :: S
integer :: n
end type
type(S) :: Sobj
type, extends(S) :: S2
integer :: m
end type
type(S2) :: S2obj
type :: T
class(S), allocatable :: x
end type
type(T) :: Tobj
Sobj = S(1)
Tobj = T(Sobj)
S2obj = S2(1,2)
print *, S2obj%n, S2obj%m
end program
Actually pr49213 is a collection of different bugs, one being this PR. IMO
pr49213 should be split along the different bugs.
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug fortran/64757] [5 Regression] ICE in fold_convert_loc, at fold-const.c:2353
2015-01-23 22:34 [Bug fortran/64757] New: internal compiler error: in fold_convert_loc, at fold-const.c:2353 mike at rilee dot net
` (3 preceding siblings ...)
2015-01-24 12:31 ` dominiq at lps dot ens.fr
@ 2015-01-24 12:35 ` janus at gcc dot gnu.org
2015-01-24 22:25 ` janus at gcc dot gnu.org
` (7 subsequent siblings)
12 siblings, 0 replies; 14+ messages in thread
From: janus at gcc dot gnu.org @ 2015-01-24 12:35 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64757
--- Comment #5 from janus at gcc dot gnu.org ---
(In reply to Dominique d'Humieres from comment #4)
> Actually pr49213 is a collection of different bugs, one being this PR.
Right. Exactly for this reason I want to keep it separate. Makes it much easier
to keep track of the different problems separately.
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug fortran/64757] [5 Regression] ICE in fold_convert_loc, at fold-const.c:2353
2015-01-23 22:34 [Bug fortran/64757] New: internal compiler error: in fold_convert_loc, at fold-const.c:2353 mike at rilee dot net
` (4 preceding siblings ...)
2015-01-24 12:35 ` janus at gcc dot gnu.org
@ 2015-01-24 22:25 ` janus at gcc dot gnu.org
2015-01-26 11:33 ` rguenth at gcc dot gnu.org
` (6 subsequent siblings)
12 siblings, 0 replies; 14+ messages in thread
From: janus at gcc dot gnu.org @ 2015-01-24 22:25 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64757
--- Comment #6 from janus at gcc dot gnu.org ---
The following is sufficient to get rid of the ICE:
Index: gcc/fortran/trans-expr.c
===================================================================
--- gcc/fortran/trans-expr.c (Revision 220084)
+++ gcc/fortran/trans-expr.c (Arbeitskopie)
@@ -6490,6 +6490,8 @@ gfc_trans_subcomponent_assign (tree dest, gfc_comp
routine below is motivated by the alloc_scalar_allocatable_for_
assignment() routine, but with the realloc portions removed and
different input. */
+ if (cm->ts.type == BT_CLASS)
+ dest = gfc_class_data_get (dest);
alloc_scalar_allocatable_for_subcomponent_assignment (&block,
dest,
cm,
However, one needs to do more to get the correct run-time behavior: The _vptr
needs to be set for the class component and one needs to use the correct size
for the memory allocation.
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug fortran/64757] [5 Regression] ICE in fold_convert_loc, at fold-const.c:2353
2015-01-23 22:34 [Bug fortran/64757] New: internal compiler error: in fold_convert_loc, at fold-const.c:2353 mike at rilee dot net
` (5 preceding siblings ...)
2015-01-24 22:25 ` janus at gcc dot gnu.org
@ 2015-01-26 11:33 ` rguenth at gcc dot gnu.org
2015-01-28 13:37 ` pault at gcc dot gnu.org
` (5 subsequent siblings)
12 siblings, 0 replies; 14+ messages in thread
From: rguenth at gcc dot gnu.org @ 2015-01-26 11:33 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64757
Richard Biener <rguenth at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Priority|P3 |P4
Target Milestone|--- |5.0
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug fortran/64757] [5 Regression] ICE in fold_convert_loc, at fold-const.c:2353
2015-01-23 22:34 [Bug fortran/64757] New: internal compiler error: in fold_convert_loc, at fold-const.c:2353 mike at rilee dot net
` (6 preceding siblings ...)
2015-01-26 11:33 ` rguenth at gcc dot gnu.org
@ 2015-01-28 13:37 ` pault at gcc dot gnu.org
2015-01-28 14:42 ` pault at gcc dot gnu.org
` (4 subsequent siblings)
12 siblings, 0 replies; 14+ messages in thread
From: pault at gcc dot gnu.org @ 2015-01-28 13:37 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64757
--- Comment #8 from Paul Thomas <pault at gcc dot gnu.org> ---
(In reply to Dominique d'Humieres from comment #4)
> > It it certainly related, but I'm not sure it is an exact duplicate.
> > In particular the above PR has quite a history and includes several
> > test cases. Let's keep it separate for now.
>
> I disagree. AFACT this PR gives the same ICE as the test in pr49213 comment
> 8 or the following variant of the original code
>
> program main
>
> type :: S
> integer :: n
> end type
> type(S) :: Sobj
>
> type, extends(S) :: S2
> integer :: m
> end type
> type(S2) :: S2obj
>
> type :: T
> class(S), allocatable :: x
> end type
> type(T) :: Tobj
>
> Sobj = S(1)
> Tobj = T(Sobj)
>
> S2obj = S2(1,2)
> print *, S2obj%n, S2obj%m
>
> end program
>
> Actually pr49213 is a collection of different bugs, one being this PR. IMO
> pr49213 should be split along the different bugs.
The patch of comment #7 fixes the above as well.
Cheers
Paul
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug fortran/64757] [5 Regression] ICE in fold_convert_loc, at fold-const.c:2353
2015-01-23 22:34 [Bug fortran/64757] New: internal compiler error: in fold_convert_loc, at fold-const.c:2353 mike at rilee dot net
` (7 preceding siblings ...)
2015-01-28 13:37 ` pault at gcc dot gnu.org
@ 2015-01-28 14:42 ` pault at gcc dot gnu.org
2015-01-28 16:19 ` dominiq at lps dot ens.fr
` (3 subsequent siblings)
12 siblings, 0 replies; 14+ messages in thread
From: pault at gcc dot gnu.org @ 2015-01-28 14:42 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64757
--- Comment #9 from Paul Thomas <pault at gcc dot gnu.org> ---
(In reply to Paul Thomas from comment #7)
> Created attachment 34607 [details]
> Draft patch for the PR
>
> I believe that this regression was caused by the fix for pr60357.
>
> The patch is regtesting right now.
>
> Paul
It bootstraps and regtests just fine. I will submit to the list sometime today.
Paul
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug fortran/64757] [5 Regression] ICE in fold_convert_loc, at fold-const.c:2353
2015-01-23 22:34 [Bug fortran/64757] New: internal compiler error: in fold_convert_loc, at fold-const.c:2353 mike at rilee dot net
` (8 preceding siblings ...)
2015-01-28 14:42 ` pault at gcc dot gnu.org
@ 2015-01-28 16:19 ` dominiq at lps dot ens.fr
2015-02-05 8:06 ` pault at gcc dot gnu.org
` (2 subsequent siblings)
12 siblings, 0 replies; 14+ messages in thread
From: dominiq at lps dot ens.fr @ 2015-01-28 16:19 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64757
--- Comment #10 from Dominique d'Humieres <dominiq at lps dot ens.fr> ---
> > Actually pr49213 is a collection of different bugs, one being this PR. IMO
> > pr49213 should be split along the different bugs.
>
> The patch of comment #7 fixes the above as well.
> It bootstraps and regtests just fine.
Confirmed.
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug fortran/64757] [5 Regression] ICE in fold_convert_loc, at fold-const.c:2353
2015-01-23 22:34 [Bug fortran/64757] New: internal compiler error: in fold_convert_loc, at fold-const.c:2353 mike at rilee dot net
` (9 preceding siblings ...)
2015-01-28 16:19 ` dominiq at lps dot ens.fr
@ 2015-02-05 8:06 ` pault at gcc dot gnu.org
2015-02-05 8:09 ` pault at gcc dot gnu.org
2015-02-05 8:45 ` burnus at gcc dot gnu.org
12 siblings, 0 replies; 14+ messages in thread
From: pault at gcc dot gnu.org @ 2015-02-05 8:06 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64757
--- Comment #11 from Paul Thomas <pault at gcc dot gnu.org> ---
Author: pault
Date: Thu Feb 5 08:06:04 2015
New Revision: 220436
URL: https://gcc.gnu.org/viewcvs?rev=220436&root=gcc&view=rev
Log:
2015-02-05 Paul Thomas <pault@gcc.gnu.org>
PR fortran/64757
* resolve.c (resolve_structure_cons): Obtain the rank of class
components.
* trans-expr.c (gfc_trans_alloc_subarray_assign): Do the
assignment to allocatable class array components.
(alloc_scalar_allocatable_for_subcomponent_assignment): If comp
is a class component, allocate to the _data field.
(gfc_trans_subcomponent_assign): If a class component with a
derived type expression set the _vptr field and for array
components, call gfc_trans_alloc_subarray_assign. For scalars,
the assignment is performed here.
2015-02-05 Paul Thomas <pault@gcc.gnu.org>
PR fortran/64757
* gfortran.dg/type_to_class_2.f90: New test
* gfortran.dg/type_to_class_3.f90: New test
Modified:
trunk/gcc/fortran/ChangeLog
trunk/gcc/testsuite/ChangeLog
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug fortran/64757] [5 Regression] ICE in fold_convert_loc, at fold-const.c:2353
2015-01-23 22:34 [Bug fortran/64757] New: internal compiler error: in fold_convert_loc, at fold-const.c:2353 mike at rilee dot net
` (10 preceding siblings ...)
2015-02-05 8:06 ` pault at gcc dot gnu.org
@ 2015-02-05 8:09 ` pault at gcc dot gnu.org
2015-02-05 8:45 ` burnus at gcc dot gnu.org
12 siblings, 0 replies; 14+ messages in thread
From: pault at gcc dot gnu.org @ 2015-02-05 8:09 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64757
Paul Thomas <pault at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |RESOLVED
Resolution|--- |FIXED
--- Comment #12 from Paul Thomas <pault at gcc dot gnu.org> ---
I screwed up the PR number in the ChangeLogs by adding an extra zero :-) The
revision for the substance of the patch was 220435.
Patch OK'd by Tobias on #gfortran
Thanks for the report
Paul
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug fortran/64757] [5 Regression] ICE in fold_convert_loc, at fold-const.c:2353
2015-01-23 22:34 [Bug fortran/64757] New: internal compiler error: in fold_convert_loc, at fold-const.c:2353 mike at rilee dot net
` (11 preceding siblings ...)
2015-02-05 8:09 ` pault at gcc dot gnu.org
@ 2015-02-05 8:45 ` burnus at gcc dot gnu.org
12 siblings, 0 replies; 14+ messages in thread
From: burnus at gcc dot gnu.org @ 2015-02-05 8:45 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64757
Tobias Burnus <burnus at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |burnus at gcc dot gnu.org
--- Comment #13 from Tobias Burnus <burnus at gcc dot gnu.org> ---
(In reply to Paul Thomas from comment #12)
> I screwed up the PR number in the ChangeLogs by adding an extra zero :-) The
> revision for the substance of the patch was 220435.
r220435 (<- is automatically turned into a link)
> Patch OK'd by Tobias on #gfortran
And at https://gcc.gnu.org/ml/fortran/2015-02/msg00022.html
Follow-up issues are tracked at PR64943, PR64944 and PR64945
^ permalink raw reply [flat|nested] 14+ messages in thread
end of thread, other threads:[~2015-02-05 8:45 UTC | newest]
Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-01-23 22:34 [Bug fortran/64757] New: internal compiler error: in fold_convert_loc, at fold-const.c:2353 mike at rilee dot net
2015-01-24 11:52 ` [Bug fortran/64757] " dominiq at lps dot ens.fr
2015-01-24 12:20 ` janus at gcc dot gnu.org
2015-01-24 12:24 ` [Bug fortran/64757] [5 Regression] ICE " janus at gcc dot gnu.org
2015-01-24 12:31 ` dominiq at lps dot ens.fr
2015-01-24 12:35 ` janus at gcc dot gnu.org
2015-01-24 22:25 ` janus at gcc dot gnu.org
2015-01-26 11:33 ` rguenth at gcc dot gnu.org
2015-01-28 13:37 ` pault at gcc dot gnu.org
2015-01-28 14:42 ` pault at gcc dot gnu.org
2015-01-28 16:19 ` dominiq at lps dot ens.fr
2015-02-05 8:06 ` pault at gcc dot gnu.org
2015-02-05 8:09 ` pault at gcc dot gnu.org
2015-02-05 8:45 ` 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).