public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/49708] New: internal compiler error with allocate and no dimensions
@ 2011-07-11 23:38 fnordxyz at yahoo dot com
2011-07-12 8:38 ` [Bug fortran/49708] [4.5/4.6/4.7 Regression] ICE " burnus at gcc dot gnu.org
` (9 more replies)
0 siblings, 10 replies; 11+ messages in thread
From: fnordxyz at yahoo dot com @ 2011-07-11 23:38 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49708
Summary: internal compiler error with allocate and no
dimensions
Product: gcc
Version: 4.6.1
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: fortran
AssignedTo: unassigned@gcc.gnu.org
ReportedBy: fnordxyz@yahoo.com
Compiling the following code with no options leads to the internal compiler
error. Expected behavior would be an error related to the missing dimension
size. Works when 'x' is declared with 'allocatable' and not 'pointer'.
subroutine fubar(x)
real, pointer, dimension(:) :: x
allocate(x)
end subroutine fubar
bug.f90: In function 'fubar':
bug.f90:5:0: internal compiler error: in gfc_array_allocate, at
fortran/trans-array.c:4372
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] 11+ messages in thread
* [Bug fortran/49708] [4.5/4.6/4.7 Regression] ICE with allocate and no dimensions
2011-07-11 23:38 [Bug fortran/49708] New: internal compiler error with allocate and no dimensions fnordxyz at yahoo dot com
@ 2011-07-12 8:38 ` burnus at gcc dot gnu.org
2011-07-12 12:28 ` janus at gcc dot gnu.org
` (8 subsequent siblings)
9 siblings, 0 replies; 11+ messages in thread
From: burnus at gcc dot gnu.org @ 2011-07-12 8:38 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49708
Tobias Burnus <burnus at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Keywords| |ice-on-invalid-code
Priority|P3 |P5
CC| |burnus at gcc dot gnu.org,
| |janus at gcc dot gnu.org
Known to work| |4.1.2, 4.3.4, 4.4.0
Target Milestone|--- |4.6.2
Summary|internal compiler error |[4.5/4.6/4.7 Regression]
|with allocate and no |ICE with allocate and no
|dimensions |dimensions
Known to fail| |4.5.3, 4.6.1, 4.7.0
--- Comment #1 from Tobias Burnus <burnus at gcc dot gnu.org> 2011-07-12 08:35:20 UTC ---
Side effect from allowing allocatable scalars in 4.5. With 4.1 to 4.4, one gets
the error:
Error: Array specification required in ALLOCATE statement at (1)
In principle, the check is still in resolve.c - the question is: Why doesn't it
trigger?
^ permalink raw reply [flat|nested] 11+ messages in thread
* [Bug fortran/49708] [4.5/4.6/4.7 Regression] ICE with allocate and no dimensions
2011-07-11 23:38 [Bug fortran/49708] New: internal compiler error with allocate and no dimensions fnordxyz at yahoo dot com
2011-07-12 8:38 ` [Bug fortran/49708] [4.5/4.6/4.7 Regression] ICE " burnus at gcc dot gnu.org
@ 2011-07-12 12:28 ` janus at gcc dot gnu.org
2011-07-12 12:39 ` janus at gcc dot gnu.org
` (7 subsequent siblings)
9 siblings, 0 replies; 11+ messages in thread
From: janus at gcc dot gnu.org @ 2011-07-12 12:28 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49708
janus at gcc dot gnu.org changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |NEW
Last reconfirmed| |2011.07.12 12:27:33
Ever Confirmed|0 |1
--- Comment #2 from janus at gcc dot gnu.org 2011-07-12 12:27:33 UTC ---
(In reply to comment #1)
> In principle, the check is still in resolve.c - the question is: Why doesn't it
> trigger?
Apparently because of the pointer attribute. Changing "pointer" to
"allocatable" in the test case will trigger the error message.
With the following patch one also gets the error message for the pointer case,
but I haven't checked if this breaks anything else:
Index: gcc/fortran/resolve.c
===================================================================
--- gcc/fortran/resolve.c (revision 175788)
+++ gcc/fortran/resolve.c (working copy)
@@ -6884,7 +6884,7 @@ resolve_allocate_expr (gfc_expr *e, gfc_code *code
gfc_find_derived_vtab (ts.u.derived);
}
- if (pointer || (dimension == 0 && codimension == 0))
+ if (dimension == 0 && codimension == 0)
goto success;
/* Make sure the last reference node is an array specifiction. */
^ permalink raw reply [flat|nested] 11+ messages in thread
* [Bug fortran/49708] [4.5/4.6/4.7 Regression] ICE with allocate and no dimensions
2011-07-11 23:38 [Bug fortran/49708] New: internal compiler error with allocate and no dimensions fnordxyz at yahoo dot com
2011-07-12 8:38 ` [Bug fortran/49708] [4.5/4.6/4.7 Regression] ICE " burnus at gcc dot gnu.org
2011-07-12 12:28 ` janus at gcc dot gnu.org
@ 2011-07-12 12:39 ` janus at gcc dot gnu.org
2011-07-12 14:45 ` janus at gcc dot gnu.org
` (6 subsequent siblings)
9 siblings, 0 replies; 11+ messages in thread
From: janus at gcc dot gnu.org @ 2011-07-12 12:39 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49708
--- Comment #3 from janus at gcc dot gnu.org 2011-07-12 12:38:55 UTC ---
I'm afraid the regression was introduced by this commit of mine:
http://gcc.gnu.org/viewcvs?view=revision&revision=151240
^ permalink raw reply [flat|nested] 11+ messages in thread
* [Bug fortran/49708] [4.5/4.6/4.7 Regression] ICE with allocate and no dimensions
2011-07-11 23:38 [Bug fortran/49708] New: internal compiler error with allocate and no dimensions fnordxyz at yahoo dot com
` (2 preceding siblings ...)
2011-07-12 12:39 ` janus at gcc dot gnu.org
@ 2011-07-12 14:45 ` janus at gcc dot gnu.org
2011-07-18 7:34 ` burnus at gcc dot gnu.org
` (5 subsequent siblings)
9 siblings, 0 replies; 11+ messages in thread
From: janus at gcc dot gnu.org @ 2011-07-12 14:45 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49708
janus at gcc dot gnu.org changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |ASSIGNED
AssignedTo|unassigned at gcc dot |janus at gcc dot gnu.org
|gnu.org |
--- Comment #4 from janus at gcc dot gnu.org 2011-07-12 14:44:30 UTC ---
(In reply to comment #2)
> With the following patch one also gets the error message for the pointer case,
> but I haven't checked if this breaks anything else:
>
>
> Index: gcc/fortran/resolve.c
> ===================================================================
> --- gcc/fortran/resolve.c (revision 175788)
> +++ gcc/fortran/resolve.c (working copy)
> @@ -6884,7 +6884,7 @@ resolve_allocate_expr (gfc_expr *e, gfc_code *code
> gfc_find_derived_vtab (ts.u.derived);
> }
>
> - if (pointer || (dimension == 0 && codimension == 0))
> + if (dimension == 0 && codimension == 0)
> goto success;
>
> /* Make sure the last reference node is an array specifiction. */
I just verified that this patch is free of testsuite regressions.
^ permalink raw reply [flat|nested] 11+ messages in thread
* [Bug fortran/49708] [4.5/4.6/4.7 Regression] ICE with allocate and no dimensions
2011-07-11 23:38 [Bug fortran/49708] New: internal compiler error with allocate and no dimensions fnordxyz at yahoo dot com
` (3 preceding siblings ...)
2011-07-12 14:45 ` janus at gcc dot gnu.org
@ 2011-07-18 7:34 ` burnus at gcc dot gnu.org
2011-07-18 17:09 ` janus at gcc dot gnu.org
` (4 subsequent siblings)
9 siblings, 0 replies; 11+ messages in thread
From: burnus at gcc dot gnu.org @ 2011-07-18 7:34 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49708
--- Comment #5 from Tobias Burnus <burnus at gcc dot gnu.org> 2011-07-18 07:33:07 UTC ---
Janus, what's the status?
(In reply to comment #4)
> I just verified that this patch is free of testsuite regressions.
The patch is OK with a test case, ChangeLog - and CCing it to
fortran@/gcc-patches@.
^ permalink raw reply [flat|nested] 11+ messages in thread
* [Bug fortran/49708] [4.5/4.6/4.7 Regression] ICE with allocate and no dimensions
2011-07-11 23:38 [Bug fortran/49708] New: internal compiler error with allocate and no dimensions fnordxyz at yahoo dot com
` (4 preceding siblings ...)
2011-07-18 7:34 ` burnus at gcc dot gnu.org
@ 2011-07-18 17:09 ` janus at gcc dot gnu.org
2011-07-19 12:42 ` janus at gcc dot gnu.org
` (3 subsequent siblings)
9 siblings, 0 replies; 11+ messages in thread
From: janus at gcc dot gnu.org @ 2011-07-18 17:09 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49708
--- Comment #6 from janus at gcc dot gnu.org 2011-07-18 17:08:43 UTC ---
(In reply to comment #5)
> Janus, what's the status?
Well, mostly "busy with other things" mixed with a bit of "waiting for comments
and/or approval" ;)
> The patch is OK with a test case, ChangeLog - and CCing it to
> fortran@/gcc-patches@.
Thanks, will commit soonish.
^ permalink raw reply [flat|nested] 11+ messages in thread
* [Bug fortran/49708] [4.5/4.6/4.7 Regression] ICE with allocate and no dimensions
2011-07-11 23:38 [Bug fortran/49708] New: internal compiler error with allocate and no dimensions fnordxyz at yahoo dot com
` (5 preceding siblings ...)
2011-07-18 17:09 ` janus at gcc dot gnu.org
@ 2011-07-19 12:42 ` janus at gcc dot gnu.org
2011-07-22 22:24 ` janus at gcc dot gnu.org
` (2 subsequent siblings)
9 siblings, 0 replies; 11+ messages in thread
From: janus at gcc dot gnu.org @ 2011-07-19 12:42 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49708
--- Comment #7 from janus at gcc dot gnu.org 2011-07-19 12:39:02 UTC ---
Author: janus
Date: Tue Jul 19 12:38:59 2011
New Revision: 176447
URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=176447
Log:
2011-07-19 Janus Weil <janus@gcc.gnu.org>
PR fortran/49708
* resolve.c (resolve_allocate_expr): Fix diagnostics for pointers.
2011-07-19 Janus Weil <janus@gcc.gnu.org>
PR fortran/49708
* gfortran.dg/allocate_error_3.f90: New.
Added:
trunk/gcc/testsuite/gfortran.dg/allocate_error_3.f90
Modified:
trunk/gcc/fortran/ChangeLog
trunk/gcc/fortran/resolve.c
trunk/gcc/testsuite/ChangeLog
^ permalink raw reply [flat|nested] 11+ messages in thread
* [Bug fortran/49708] [4.5/4.6/4.7 Regression] ICE with allocate and no dimensions
2011-07-11 23:38 [Bug fortran/49708] New: internal compiler error with allocate and no dimensions fnordxyz at yahoo dot com
` (6 preceding siblings ...)
2011-07-19 12:42 ` janus at gcc dot gnu.org
@ 2011-07-22 22:24 ` janus at gcc dot gnu.org
2011-07-23 14:45 ` janus at gcc dot gnu.org
2011-07-23 14:53 ` janus at gcc dot gnu.org
9 siblings, 0 replies; 11+ messages in thread
From: janus at gcc dot gnu.org @ 2011-07-22 22:24 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49708
--- Comment #8 from janus at gcc dot gnu.org 2011-07-22 22:24:22 UTC ---
Author: janus
Date: Fri Jul 22 22:24:19 2011
New Revision: 176659
URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=176659
Log:
2011-07-23 Janus Weil <janus@gcc.gnu.org>
PR fortran/49708
* resolve.c (resolve_allocate_expr): Fix diagnostics for pointers.
2011-07-23 Janus Weil <janus@gcc.gnu.org>
PR fortran/49708
* gfortran.dg/allocate_error_3.f90: New.
Added:
branches/gcc-4_6-branch/gcc/testsuite/gfortran.dg/allocate_error_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] 11+ messages in thread
* [Bug fortran/49708] [4.5/4.6/4.7 Regression] ICE with allocate and no dimensions
2011-07-11 23:38 [Bug fortran/49708] New: internal compiler error with allocate and no dimensions fnordxyz at yahoo dot com
` (7 preceding siblings ...)
2011-07-22 22:24 ` janus at gcc dot gnu.org
@ 2011-07-23 14:45 ` janus at gcc dot gnu.org
2011-07-23 14:53 ` janus at gcc dot gnu.org
9 siblings, 0 replies; 11+ messages in thread
From: janus at gcc dot gnu.org @ 2011-07-23 14:45 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49708
--- Comment #9 from janus at gcc dot gnu.org 2011-07-23 14:44:27 UTC ---
Author: janus
Date: Sat Jul 23 14:44:22 2011
New Revision: 176688
URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=176688
Log:
2011-07-23 Janus Weil <janus@gcc.gnu.org>
PR fortran/49708
* resolve.c (resolve_allocate_expr): Fix diagnostics for pointers.
2011-07-23 Janus Weil <janus@gcc.gnu.org>
PR fortran/49708
* gfortran.dg/allocate_error_3.f90: New.
Added:
branches/gcc-4_5-branch/gcc/testsuite/gfortran.dg/allocate_error_3.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] 11+ messages in thread
* [Bug fortran/49708] [4.5/4.6/4.7 Regression] ICE with allocate and no dimensions
2011-07-11 23:38 [Bug fortran/49708] New: internal compiler error with allocate and no dimensions fnordxyz at yahoo dot com
` (8 preceding siblings ...)
2011-07-23 14:45 ` janus at gcc dot gnu.org
@ 2011-07-23 14:53 ` janus at gcc dot gnu.org
9 siblings, 0 replies; 11+ messages in thread
From: janus at gcc dot gnu.org @ 2011-07-23 14:53 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49708
janus at gcc dot gnu.org changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|ASSIGNED |RESOLVED
Resolution| |FIXED
--- Comment #10 from janus at gcc dot gnu.org 2011-07-23 14:53:09 UTC ---
Fixed on 4.5, 4.6 and trunk. Closing.
And thanks for the report!
^ permalink raw reply [flat|nested] 11+ messages in thread
end of thread, other threads:[~2011-07-23 14:53 UTC | newest]
Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-07-11 23:38 [Bug fortran/49708] New: internal compiler error with allocate and no dimensions fnordxyz at yahoo dot com
2011-07-12 8:38 ` [Bug fortran/49708] [4.5/4.6/4.7 Regression] ICE " burnus at gcc dot gnu.org
2011-07-12 12:28 ` janus at gcc dot gnu.org
2011-07-12 12:39 ` janus at gcc dot gnu.org
2011-07-12 14:45 ` janus at gcc dot gnu.org
2011-07-18 7:34 ` burnus at gcc dot gnu.org
2011-07-18 17:09 ` janus at gcc dot gnu.org
2011-07-19 12:42 ` janus at gcc dot gnu.org
2011-07-22 22:24 ` janus at gcc dot gnu.org
2011-07-23 14:45 ` janus at gcc dot gnu.org
2011-07-23 14:53 ` janus 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).