gcc version 4.2.0 20060501 (experimental) > gfortran -c -O2 bug.f90 bug.f90: In function âreset_to_next_rng_substreamâ: bug.f90:11: internal compiler error: in add_virtual_operand, at tree-ssa-operands.c:1284 for : > cat bug.f90 MODULE parallel_rng_types INTEGER, PARAMETER :: dp=KIND(0.0D0) TYPE rng_stream_type REAL(KIND=dp), DIMENSION(3,2) :: bg,cg,ig LOGICAL :: antithetic,extended_precision END TYPE rng_stream_type TYPE cp_error_type INTEGER :: dum END TYPE CONTAINS SUBROUTINE reset_to_next_rng_substream(rng_stream,error) TYPE(rng_stream_type), POINTER :: rng_stream LOGICAL :: failure REAL(KIND=dp), DIMENSION(3, 2) :: u CALL cp_assert(ASSOCIATED(rng_stream),2,routineP,error,failure) IF (.NOT.failure) THEN rng_stream%bg = u rng_stream%cg = u END IF END SUBROUTINE reset_to_next_rng_substream END MODULE
Confirmed, not fixed by the patch which fixes PR 26626. Here is a reduced Fortran testcase: MODULE parallel_rng_types INTEGER, PARAMETER :: dp=KIND(0.0D0) TYPE rng_stream_type REAL(KIND=dp), DIMENSION(1) :: bg,cg LOGICAL :: antithetic END TYPE CONTAINS SUBROUTINE reset_to_next_rng_substream(rng_stream,error) TYPE(rng_stream_type), POINTER :: rng_stream LOGICAL :: failure CALL cp_assert(ASSOCIATED(rng_stream),routineP,error,failure) IF (.NOT.failure) THEN rng_stream%bg = u rng_stream%cg = u END IF END SUBROUTINE reset_to_next_rng_substream END MODULE ----- I might get a reduced C one soon or not.
And here is the C example (so this does not become not release blocking): typedef struct atype { float bg[1], cg[1]; _Bool ant; }atype; void cp_assert(_Bool*, float*, int*, _Bool*); void f(atype **rng_stream, int *error, float u) { _Bool t = *rng_stream != 0; float routinep; _Bool failure; cp_assert ( &t, &routinep, error, &failure); if (failure == 0) { typedef float ty[1]; ty *tt = &((*rng_stream)->bg); int i = 1; do { (*tt)[i - 1] = u; i ++; }while (i > 1); { ty *tt = &(*rng_stream)->cg; int i = 1; do { (*tt)[i - 1] = u; i ++; }while (i > 1); } } }
The patch for PR26626 doesn't fix this either.
ICEing in the propagator engine during copyprop: Substituing values and folding statements Folded statement: tt_19 = &D.1547_18->cg; into: tt_19 = &D.1547_12->cg; *kaboom* but same usual place: #1 0x081881af in add_virtual_operand (var=0xb7d8e410, s_ann=0xb7e1a7ec, flags=1, full_ref=0xb7e1a208, offset=32, size=32, for_clobber=0 '\0') at /space/rguenther/src/svn/trunk/gcc/tree-ssa-operands.c:1284 1284 gcc_assert (SMT_USED_ALONE (var)); (gdb) call debug_generic_expr(stmt) # SMT.8D.1563_39 = V_MAY_DEF <SMT.8D.1563_14>; D.1547_12->cgD.1522[D.1552_21] = uD.1532_16
Subject: Re: [4.2 Regression] ICE: add_virtual_operand with pointers to arrays On Tue, 2006-05-02 at 08:56 +0000, rguenth at gcc dot gnu dot org wrote: > > ------- Comment #4 from rguenth at gcc dot gnu dot org 2006-05-02 08:56 ------- > ICEing in the propagator engine during copyprop: > > Substituing values and folding statements > > Folded statement: tt_19 = &D.1547_18->cg; > into: tt_19 = &D.1547_12->cg; > > *kaboom* > > but same usual place: > > #1 0x081881af in add_virtual_operand (var=0xb7d8e410, s_ann=0xb7e1a7ec, > flags=1, full_ref=0xb7e1a208, offset=32, size=32, for_clobber=0 '\0') > at /space/rguenther/src/svn/trunk/gcc/tree-ssa-operands.c:1284 > 1284 gcc_assert (SMT_USED_ALONE (var)); > > (gdb) call debug_generic_expr(stmt) > # SMT.8D.1563_39 = V_MAY_DEF <SMT.8D.1563_14>; > D.1547_12->cgD.1522[D.1552_21] = uD.1532_16 This is a different bug, in fact. Those two (D.1547_18 and D.1547_12) should have had the exact same SMT base, AFAICT, and thus, should have had the same result. What do the alias dumps look like after the patch from 26626?
Any progress on this one? It's blocking a few widely-used Fortran codes from compiling (and being used and benchmarked) with mainline gfortran.
We aren't marking smt usage for updating in forwprop, but we need to, because forwprop is propagating and address and destroying the smt info.
Subject: Bug 27373 Author: dberlin Date: Wed May 17 01:16:08 2006 New Revision: 113840 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=113840 Log: 2006-05-16 Daniel Berlin <dberlin@dberlin.org> Fix PR tree-optimization/27373 * tree-ssa-forwprop.c: (forward_propagate_addr_expr_1): Add argument. (forward_propagate_addr_expr): Update call. Added: trunk/gcc/testsuite/gcc.c-torture/compile/pr27373.c Modified: trunk/gcc/ChangeLog trunk/gcc/tree-ssa-forwprop.c
Fixed
*** Bug 27085 has been marked as a duplicate of this bug. ***