Summary: | ICE in gfc_conv_array_index_offset | ||
---|---|---|---|
Product: | gcc | Reporter: | Maik Beckmann <beckmann.maik> |
Component: | fortran | Assignee: | Jerry DeLisle <jvdelisle2> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | dfranke, gcc-bugs |
Priority: | P3 | Keywords: | ice-on-valid-code |
Version: | 4.3.0 | ||
Target Milestone: | --- | ||
Host: | Target: | ||
Build: | Known to work: | ||
Known to fail: | 4.1.3 4.2.2 4.3.0 | Last reconfirmed: | 2008-03-15 16:25:57 |
Bug Depends on: | |||
Bug Blocks: | 32834 |
Description
Maik Beckmann
2008-02-13 18:07:35 UTC
Confirmed. Seems to be related to ELEMENTAL and IN probalby not having a proper array descriptor. If my_sub is written as: SUBROUTINE my_sub (in, out) TYPE(bar), DIMENSION(42, 42) :: in, out out(1, 1:42) = in(1, 1:42) ! ELEMENTAL SUBROUTINE ASSIGN_BAR END SUBROUTINE no ICE occurs. Same if the subroutine ASSIGN_BAR is called directly using the pointers from the original example, i.e.: SUBROUTINE my_sub (in, out) TYPE(bar), DIMENSION(:,:), POINTER :: in TYPE(bar), DIMENSION(:,:), POINTER :: out ALLOCATE(out(1:42, 1:42)) CALL assign_bar(out(1, 1:42), in(1, 1:42)) END SUBROUTINE The latter probably doesn't make use of the ELEMENTALness of ASSIGN_BAR. Removing this assert on this argument being passed in seems to resolve this issue. I wonder if this was a leftover from a debugging session. Index: trans-array.c =================================================================== --- trans-array.c (revision 133203) +++ trans-array.c (working copy) @@ -2209,7 +2209,6 @@ gfc_conv_array_index_offset (gfc_se * se switch (ar->dimen_type[dim]) { case DIMEN_ELEMENT: - gcc_assert (i == -1); /* Elemental dimension. */ gcc_assert (info->subscript[dim] && info->subscript[dim]->type == GFC_SS_SCALAR); Subject: Bug 35184 Author: jvdelisle Date: Sat Mar 15 16:45:12 2008 New Revision: 133252 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=133252 Log: 2008-03-15 Jerry DeLisle <jvdelisle@gcc.gnu.org> PR fortran/35184 * trans-array.c (gfc_conv_array_index_offset): Remove unnecessary assert. Modified: trunk/gcc/fortran/ChangeLog trunk/gcc/fortran/trans-array.c Subject: Bug 35184 Author: jvdelisle Date: Sat Mar 15 16:53:05 2008 New Revision: 133253 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=133253 Log: 2008-03-15 Jerry DeLisle <jvdelisle@gcc.gnu.org> PR testsuite/35184 gfortran.dg/elemental_subroutine_6.f90: New test. Added: trunk/gcc/testsuite/gfortran.dg/elemental_subroutine_6.f90 Modified: trunk/gcc/testsuite/ChangeLog Closing. Fixed on 4.4 (In reply to comment #5) > Closing. Fixed on 4.4 > Jerry, many thanks for fixing this! Since this patch is very minor I hope it will be applied to 4.3 before 4.3.1 is out (building gcc on windows isn't fun). Best, -- Maik Subject: Bug 35184 Author: jvdelisle Date: Sun May 18 00:32:22 2008 New Revision: 135492 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=135492 Log: 2008-05-17 Jerry DeLisle <jvdelisle@gcc.gnu.org> Backport from mainline: PR fortran/35184 * trans-array.c (gfc_conv_array_index_offset): Remove unnecessary assert. Modified: branches/gcc-4_3-branch/gcc/fortran/ChangeLog branches/gcc-4_3-branch/gcc/fortran/trans-array.c |