Summary: | [4.3 Regression] Structure component arrays | ||
---|---|---|---|
Product: | gcc | Reporter: | Thomas Koenig <tkoenig> |
Component: | fortran | Assignee: | Paul Thomas <pault> |
Status: | RESOLVED FIXED | ||
Severity: | critical | CC: | burnus, gcc-bugs |
Priority: | P3 | Keywords: | wrong-code |
Version: | 4.3.0 | ||
Target Milestone: | --- | ||
Host: | Target: | ||
Build: | Known to work: | 4.1.3 4.2.1 | |
Known to fail: | 4.3.0 | Last reconfirmed: | 2007-09-10 07:20:46 |
Bug Depends on: | |||
Bug Blocks: | 32834 |
Description
Thomas Koenig
2007-09-09 19:31:51 UTC
Reduced testcase due to Paul Thomas: $ cat > goo.f90 program main type foo integer :: i character(len=3) :: c end type foo type(foo), dimension(4), target :: a a%i = (/ 12, 2, 3, 10 /) print *, a%i end program main $ gfortran goo.f90 $ ./a.out 12 3 68 0 Confirmed. gfortran 4.2: struct foo a[4]; int4 A.1[4]; struct array1_int4 atmp.0; [...] static int4 data.3[4] = {12, 2, 3, 10}; __builtin_memcpy (&(*(int4[0:] *) atmp.0.data)[0], &data.3, 16); [...] a[NON_LVALUE_EXPR<S.4>].i = (*(int4[0:] *) atmp.0.data)[NON_LVALUE_EXPR<S.4>]; gfortran 4.3: struct foo a[4]; static int4 A.1[4] = {12, 2, 3, 10}; (void) __builtin_memcpy ((void *) &a, (void *) &A.1, 32); I am just about to commit as 'obvious' a patch that bootstraps and regtests on x86_ia64/FC5 Paul Subject: Bug 33370 Author: pault Date: Mon Sep 10 07:54:17 2007 New Revision: 128325 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=128325 Log: 2007-09-10 Paul Thomas <pault@gcc.gnu.org> PR fortran/33370 * trans-expr.c (copyable_array_p): Add tests that expression is a variable, that it has no subreferences and that it is a full array. (gfc_trans_assignment): Change conditions to suit modifications to copyable_array_p. 2007-09-10 Paul Thomas <pault@gcc.gnu.org> PR fortran/33370 * gfortran.dg/array_memcpy_5.f90: New test. Added: trunk/gcc/testsuite/gfortran.dg/array_memcpy_5.f90 Modified: trunk/gcc/fortran/ChangeLog trunk/gcc/fortran/trans-expr.c trunk/gcc/testsuite/ChangeLog Fixed under the 'obvious' rule. Paul |