public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/45745] New: [4.6 Regression] ICE in gfc_conv_array_stride
@ 2010-09-22 6:28 Joost dot VandeVondele at pci dot uzh dot ch
2010-09-22 6:29 ` [Bug fortran/45745] " Joost dot VandeVondele at pci dot uzh dot ch
` (8 more replies)
0 siblings, 9 replies; 10+ messages in thread
From: Joost dot VandeVondele at pci dot uzh dot ch @ 2010-09-22 6:28 UTC (permalink / raw)
To: gcc-bugs
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 4976 bytes --]
Very recent regression:
Program received signal SIGSEGV, Segmentation fault.
gfc_conv_array_stride (descriptor=0x0, dim=0) at
/data03/vondele/gcc_trunk/gcc/gcc/fortran/trans-array.c:2259
2259 type = TREE_TYPE (descriptor);
(gdb) bt
#0 gfc_conv_array_stride (descriptor=0x0, dim=0) at
/data03/vondele/gcc_trunk/gcc/gcc/fortran/trans-array.c:2259
#1 0x000000000055afb5 in gfc_conv_array_index_offset (se=0x7fff9584ab70,
info=0x143d930, dim=<value optimized out>, i=<value optimized out>,
ar=0x1444538, stride=0x7f5a5fc5a780) at
/data03/vondele/gcc_trunk/gcc/gcc/fortran/trans-array.c:2450
#2 0x000000000055b0c2 in gfc_conv_scalarized_array_ref (se=0x7fff9584ab70,
ar=0x30)
at /data03/vondele/gcc_trunk/gcc/gcc/fortran/trans-array.c:2524
#3 0x000000000055cdad in gfc_conv_array_ref (se=0x7fff9584ab70, ar=0x0,
sym=0x1441920, where=0x1444340)
at /data03/vondele/gcc_trunk/gcc/gcc/fortran/trans-array.c:2574
#4 0x000000000057c14a in gfc_conv_variable (se=0x7fff9584ab70, expr=0x14442f0)
at /data03/vondele/gcc_trunk/gcc/gcc/fortran/trans-expr.c:731
#5 0x000000000057bb54 in gfc_conv_expr_val (se=0x7fff9584ab70, expr=0x0) at
/data03/vondele/gcc_trunk/gcc/gcc/fortran/trans-expr.c:4662
#6 0x000000000055eb24 in gfc_conv_expr_descriptor (se=0x7fff9584ae60,
expr=0x14442f0, ss=0x143d910)
at /data03/vondele/gcc_trunk/gcc/gcc/fortran/trans-array.c:5414
#7 0x0000000000562005 in gfc_conv_array_parameter (se=0x7fff9584ae60,
expr=0x14442f0, ss=0x143d910, g77=1 '\001', fsym=0x0,
proc_name=0x7f5a5fb6ff98 "m_loc_r", size=0x0) at
/data03/vondele/gcc_trunk/gcc/gcc/fortran/trans-array.c:5836
#8 0x0000000000576717 in gfc_conv_procedure_call (se=0x7fff9584b360,
sym=0x1444080, args=0x13e25a0, expr=0x1444230, append_args=0x0)
at /data03/vondele/gcc_trunk/gcc/gcc/fortran/trans-expr.c:3073
#9 0x0000000000578f9a in gfc_conv_function_expr (se=0x7fff9584b360, expr=0x0)
at /data03/vondele/gcc_trunk/gcc/gcc/fortran/trans-expr.c:3932
#10 0x000000000057b818 in gfc_conv_expr_reference (se=0x0, expr=0x0) at
/data03/vondele/gcc_trunk/gcc/gcc/fortran/trans-expr.c:4736
#11 0x000000000058d10a in gfc_trans_transfer (code=0x1444b30) at
/data03/vondele/gcc_trunk/gcc/gcc/fortran/trans-io.c:2246
#12 0x0000000000552700 in trans_code (code=0x1444b30, cond=0x7f5a617f13f0) at
/data03/vondele/gcc_trunk/gcc/gcc/fortran/trans.c:1302
#13 0x000000000058fc89 in build_dt (function=0x7f5a5fc49e00, code=0x1444d70) at
/data03/vondele/gcc_trunk/gcc/gcc/fortran/trans-io.c:1817
#14 0x0000000000552740 in trans_code (code=0x1444d70, cond=0x0) at
/data03/vondele/gcc_trunk/gcc/gcc/fortran/trans.c:1274
#15 0x0000000000599878 in gfc_trans_if_1 (code=0x1442550) at
/data03/vondele/gcc_trunk/gcc/gcc/fortran/trans-stmt.c:733
#16 0x000000000059993a in gfc_trans_if (code=0x1442ac0) at
/data03/vondele/gcc_trunk/gcc/gcc/fortran/trans-stmt.c:763
#17 0x00000000005529a8 in trans_code (code=0x1442ac0, cond=0x0) at
/data03/vondele/gcc_trunk/gcc/gcc/fortran/trans.c:1205
#18 0x000000000059dd6e in gfc_trans_select (code=0x1442220) at
/data03/vondele/gcc_trunk/gcc/gcc/fortran/trans-stmt.c:1529
#19 0x0000000000552928 in trans_code (code=0x1442220, cond=0x0) at
/data03/vondele/gcc_trunk/gcc/gcc/fortran/trans.c:1225
#20 0x000000000056e602 in gfc_generate_function_code (ns=0x1440d70) at
/data03/vondele/gcc_trunk/gcc/gcc/fortran/trans-decl.c:4629
#21 0x00000000005520aa in gfc_generate_module_code (ns=0x143eaf0) at
/data03/vondele/gcc_trunk/gcc/gcc/fortran/trans.c:1433
#22 0x0000000000515bcc in gfc_parse_file () at
/data03/vondele/gcc_trunk/gcc/gcc/fortran/parse.c:4377
for the following testcase:
MODULE pw_types
INTEGER, PARAMETER :: dp=8
TYPE pw_type
REAL (KIND=dp), DIMENSION ( : ), POINTER :: cr
INTEGER :: in_use
END TYPE pw_type
INTEGER, PARAMETER, PUBLIC :: REALDATA1D = 301
CONTAINS
SUBROUTINE pw_write(pw, unit_nr, error)
TYPE(pw_type), INTENT(in) :: pw
INTEGER, INTENT(in) :: unit_nr
SELECT CASE(pw%in_use)
CASE (REALDATA1D)
IF (ASSOCIATED(pw%cr)) THEN
WRITE (unit=unit_nr, &
fmt="(' cr=<real(',i8,':',i8,')at 0x',z16.16,'>')")&
LBOUND(pw%cr,1),UBOUND(pw%cr,1),m_loc_r(pw%cr(LBOUND(pw%cr)))
END IF
END SELECT
END SUBROUTINE pw_write
END MODULE
reproduce with:
> gfortran bug.f90
bug.f90: In function pw_write:
bug.f90:17:0: 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.
--
Summary: [4.6 Regression] ICE in gfc_conv_array_stride
Product: gcc
Version: 4.6.0
Status: UNCONFIRMED
Keywords: ice-on-valid-code
Severity: normal
Priority: P3
Component: fortran
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: Joost dot VandeVondele at pci dot uzh dot ch
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45745
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug fortran/45745] [4.6 Regression] ICE in gfc_conv_array_stride
2010-09-22 6:28 [Bug fortran/45745] New: [4.6 Regression] ICE in gfc_conv_array_stride Joost dot VandeVondele at pci dot uzh dot ch
@ 2010-09-22 6:29 ` Joost dot VandeVondele at pci dot uzh dot ch
2010-09-22 8:25 ` burnus at gcc dot gnu dot org
` (7 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: Joost dot VandeVondele at pci dot uzh dot ch @ 2010-09-22 6:29 UTC (permalink / raw)
To: gcc-bugs
--
Joost dot VandeVondele at pci dot uzh dot ch changed:
What |Removed |Added
----------------------------------------------------------------------------
Known to fail| |4.6.0
Known to work| |4.5.0
Target Milestone|--- |4.6.0
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45745
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug fortran/45745] [4.6 Regression] ICE in gfc_conv_array_stride
2010-09-22 6:28 [Bug fortran/45745] New: [4.6 Regression] ICE in gfc_conv_array_stride Joost dot VandeVondele at pci dot uzh dot ch
2010-09-22 6:29 ` [Bug fortran/45745] " Joost dot VandeVondele at pci dot uzh dot ch
@ 2010-09-22 8:25 ` burnus at gcc dot gnu dot org
2010-09-22 13:58 ` mikael at gcc dot gnu dot org
` (6 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: burnus at gcc dot gnu dot org @ 2010-09-22 8:25 UTC (permalink / raw)
To: gcc-bugs
------- Comment #1 from burnus at gcc dot gnu dot org 2010-09-22 08:24 -------
Works Rev. 164472
Fails Rev. 164509 (ICE)
Mikael, I think your patch could be the culprit (Rev. 164494, PR 45648).
--
burnus at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |mikael at gcc dot gnu dot
| |org
Status|UNCONFIRMED |NEW
Ever Confirmed|0 |1
Last reconfirmed|0000-00-00 00:00:00 |2010-09-22 08:24:53
date| |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45745
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug fortran/45745] [4.6 Regression] ICE in gfc_conv_array_stride
2010-09-22 6:28 [Bug fortran/45745] New: [4.6 Regression] ICE in gfc_conv_array_stride Joost dot VandeVondele at pci dot uzh dot ch
2010-09-22 6:29 ` [Bug fortran/45745] " Joost dot VandeVondele at pci dot uzh dot ch
2010-09-22 8:25 ` burnus at gcc dot gnu dot org
@ 2010-09-22 13:58 ` mikael at gcc dot gnu dot org
2010-09-22 15:12 ` mikael at gcc dot gnu dot org
` (5 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: mikael at gcc dot gnu dot org @ 2010-09-22 13:58 UTC (permalink / raw)
To: gcc-bugs
------- Comment #2 from mikael at gcc dot gnu dot org 2010-09-22 13:58 -------
(In reply to comment #1)
> Mikael, I think your patch could be the culprit (Rev. 164494, PR 45648).
>
Confirmed, it's mine.
reduced a bit:
MODULE pw_types
TYPE pw_type
REAL, DIMENSION ( : ), POINTER :: cr
END TYPE pw_type
CONTAINS
SUBROUTINE pw_write(pw)
TYPE(pw_type), INTENT(in) :: pw
PRINT *, pw%cr(LBOUND(pw%cr))
END SUBROUTINE pw_write
END MODULE
--
mikael at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
AssignedTo|unassigned at gcc dot gnu |mikael at gcc dot gnu dot
|dot org |org
Status|NEW |ASSIGNED
Last reconfirmed|2010-09-22 08:24:53 |2010-09-22 13:58:33
date| |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45745
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug fortran/45745] [4.6 Regression] ICE in gfc_conv_array_stride
2010-09-22 6:28 [Bug fortran/45745] New: [4.6 Regression] ICE in gfc_conv_array_stride Joost dot VandeVondele at pci dot uzh dot ch
` (2 preceding siblings ...)
2010-09-22 13:58 ` mikael at gcc dot gnu dot org
@ 2010-09-22 15:12 ` mikael at gcc dot gnu dot org
2010-09-22 15:13 ` mikael at gcc dot gnu dot org
` (4 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: mikael at gcc dot gnu dot org @ 2010-09-22 15:12 UTC (permalink / raw)
To: gcc-bugs
------- Comment #3 from mikael at gcc dot gnu dot org 2010-09-22 15:12 -------
Patch 4/5 in the patchset(http://gcc.gnu.org/ml/fortran/2010-09/msg00369.html)
changed this:
secss = ss;
/* Look for the SS for this function. */
while (secss != gfc_ss_terminator
&& (secss->type != GFC_SS_FUNCTION || secss->expr != expr))
secss = secss->next;
[...]
if (secss == gfc_ss_terminator)
{
/* Elemental function. */
to:
if (ss->expr != expr)
{
/* Elemental function. */
But to be equivalent to the loop exit condition, it should be:
if (ss->expr != expr || ss->type != GFC_SS_FUNCTION)
{
/* Elemental function. */
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45745
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug fortran/45745] [4.6 Regression] ICE in gfc_conv_array_stride
2010-09-22 6:28 [Bug fortran/45745] New: [4.6 Regression] ICE in gfc_conv_array_stride Joost dot VandeVondele at pci dot uzh dot ch
` (3 preceding siblings ...)
2010-09-22 15:12 ` mikael at gcc dot gnu dot org
@ 2010-09-22 15:13 ` mikael at gcc dot gnu dot org
2010-09-22 21:45 ` dominiq at lps dot ens dot fr
` (3 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: mikael at gcc dot gnu dot org @ 2010-09-22 15:13 UTC (permalink / raw)
To: gcc-bugs
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 1375 bytes --]
------- Comment #4 from mikael at gcc dot gnu dot org 2010-09-22 15:13 -------
I will test this:
Index: trans-array.c
===================================================================
--- trans-array.c (révision 164494)
+++ trans-array.c (copie de travail)
@@ -5290,13 +5290,17 @@ gfc_conv_expr_descriptor (gfc_se * se, gfc_expr *
return;
}
- if (ss->expr != expr)
+ if (ss->expr != expr || ss->type != GFC_SS_FUNCTION)
{
- /* Elemental function. */
- gcc_assert ((expr->value.function.esym != NULL
- && expr->value.function.esym->attr.elemental)
- || (expr->value.function.isym != NULL
- && expr->value.function.isym->elemental));
+ if (ss->expr != expr)
+ /* Elemental function. */
+ gcc_assert ((expr->value.function.esym != NULL
+ && expr->value.function.esym->attr.elemental)
+ || (expr->value.function.isym != NULL
+ && expr->value.function.isym->elemental));
+ else
+ gcc_assert (ss->type == GFC_SS_INTRINSIC);
+
need_tmp = 1;
if (expr->ts.type == BT_CHARACTER
&& expr->ts.u.cl->length->expr_type != EXPR_CONSTANT)
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45745
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug fortran/45745] [4.6 Regression] ICE in gfc_conv_array_stride
2010-09-22 6:28 [Bug fortran/45745] New: [4.6 Regression] ICE in gfc_conv_array_stride Joost dot VandeVondele at pci dot uzh dot ch
` (4 preceding siblings ...)
2010-09-22 15:13 ` mikael at gcc dot gnu dot org
@ 2010-09-22 21:45 ` dominiq at lps dot ens dot fr
2010-09-23 11:11 ` mikael at gcc dot gnu dot org
` (2 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: dominiq at lps dot ens dot fr @ 2010-09-22 21:45 UTC (permalink / raw)
To: gcc-bugs
------- Comment #5 from dominiq at lps dot ens dot fr 2010-09-22 21:45 -------
I cannot OK the patch in comment #4, but it fixes this PR without regression.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45745
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug fortran/45745] [4.6 Regression] ICE in gfc_conv_array_stride
2010-09-22 6:28 [Bug fortran/45745] New: [4.6 Regression] ICE in gfc_conv_array_stride Joost dot VandeVondele at pci dot uzh dot ch
` (5 preceding siblings ...)
2010-09-22 21:45 ` dominiq at lps dot ens dot fr
@ 2010-09-23 11:11 ` mikael at gcc dot gnu dot org
2010-09-23 13:24 ` burnus at gcc dot gnu dot org
2010-09-23 13:36 ` Joost dot VandeVondele at pci dot uzh dot ch
8 siblings, 0 replies; 10+ messages in thread
From: mikael at gcc dot gnu dot org @ 2010-09-23 11:11 UTC (permalink / raw)
To: gcc-bugs
------- Comment #6 from mikael at gcc dot gnu dot org 2010-09-23 11:11 -------
Subject: Bug 45745
Author: mikael
Date: Thu Sep 23 11:11:23 2010
New Revision: 164558
URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=164558
Log:
2010-09-23 Mikael Morin <mikael@gcc.gnu.org>
PR fortran/45745
PR fortran/45648
* trans-array.c (gfc_conv_expr_descriptor): Handle
ss->type == GFC_SS_INTRINSIC (for {l,u}bound intrinsics) case.
2010-09-23 Mikael Morin <mikael@gcc.gnu.org>
PR fortran/45745
PR fortran/45648
* gfortran.dg/vector_subscript_bound_1.f90: New.
Added:
trunk/gcc/testsuite/gfortran.dg/vector_subscript_bound_1.f90
Modified:
trunk/gcc/fortran/ChangeLog
trunk/gcc/fortran/trans-array.c
trunk/gcc/testsuite/ChangeLog
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45745
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug fortran/45745] [4.6 Regression] ICE in gfc_conv_array_stride
2010-09-22 6:28 [Bug fortran/45745] New: [4.6 Regression] ICE in gfc_conv_array_stride Joost dot VandeVondele at pci dot uzh dot ch
` (6 preceding siblings ...)
2010-09-23 11:11 ` mikael at gcc dot gnu dot org
@ 2010-09-23 13:24 ` burnus at gcc dot gnu dot org
2010-09-23 13:36 ` Joost dot VandeVondele at pci dot uzh dot ch
8 siblings, 0 replies; 10+ messages in thread
From: burnus at gcc dot gnu dot org @ 2010-09-23 13:24 UTC (permalink / raw)
To: gcc-bugs
------- Comment #7 from burnus at gcc dot gnu dot org 2010-09-23 13:23 -------
Can the PR be closed? Or is something still missing?
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45745
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug fortran/45745] [4.6 Regression] ICE in gfc_conv_array_stride
2010-09-22 6:28 [Bug fortran/45745] New: [4.6 Regression] ICE in gfc_conv_array_stride Joost dot VandeVondele at pci dot uzh dot ch
` (7 preceding siblings ...)
2010-09-23 13:24 ` burnus at gcc dot gnu dot org
@ 2010-09-23 13:36 ` Joost dot VandeVondele at pci dot uzh dot ch
8 siblings, 0 replies; 10+ messages in thread
From: Joost dot VandeVondele at pci dot uzh dot ch @ 2010-09-23 13:36 UTC (permalink / raw)
To: gcc-bugs
------- Comment #8 from Joost dot VandeVondele at pci dot uzh dot ch 2010-09-23 13:36 -------
with the patch in place, CP2K compiles fine again. Thanks, closing as fixed.
--
Joost dot VandeVondele at pci dot uzh dot ch changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|ASSIGNED |RESOLVED
Resolution| |FIXED
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45745
^ permalink raw reply [flat|nested] 10+ messages in thread
end of thread, other threads:[~2010-09-23 13:36 UTC | newest]
Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-09-22 6:28 [Bug fortran/45745] New: [4.6 Regression] ICE in gfc_conv_array_stride Joost dot VandeVondele at pci dot uzh dot ch
2010-09-22 6:29 ` [Bug fortran/45745] " Joost dot VandeVondele at pci dot uzh dot ch
2010-09-22 8:25 ` burnus at gcc dot gnu dot org
2010-09-22 13:58 ` mikael at gcc dot gnu dot org
2010-09-22 15:12 ` mikael at gcc dot gnu dot org
2010-09-22 15:13 ` mikael at gcc dot gnu dot org
2010-09-22 21:45 ` dominiq at lps dot ens dot fr
2010-09-23 11:11 ` mikael at gcc dot gnu dot org
2010-09-23 13:24 ` burnus at gcc dot gnu dot org
2010-09-23 13:36 ` Joost dot VandeVondele at pci dot uzh dot ch
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).