The test case fortran.dg/equiv_7.f90 fails with -m64 -Os on powerpc-apple-darwin9. I have reduced the code to: call derived_types ! Thanks to Tobias Burnus for this:) print *, d1mach (1), transfer ((/0_4, 1048576_4/), 1d0) if (d1mach (1) .ne. transfer ((/0_4, 1048576_4/), 1d0)) call abort () contains function d1mach(i) implicit none double precision d1mach,dmach(5) integer i,large(4),small(4) equivalence ( dmach(1), small(1) ) equivalence ( dmach(2), large(1) ) data small(1),small(2) / 0, 1048576/ data large(1),large(2) /-1,2146435071/ d1mach = dmach(i) end function d1mach subroutine derived_types TYPE T2 sequence character (3) :: chr = "wxy" END TYPE T2 TYPE(T2) :: a2 if (a2%chr .ne. "wxy") call abort () end subroutine derived_types end I don't see it on i686-apple-darwin9 and it worked at rev. 132355. The failure disappears if I comment the CALL. I wonder if it is not another side effect of rev. 132566: * config/rs6000/rs6000.h (CONSTANT_ALIGNMENT): Don't overalign strings when optimizing for size, unless the target cares about alignment.
If I revert the patch of revision 132566, the failure disappears. It seems that the condition "(STRICT_ALIGNMENT || !optimize_size)" should be tune to handle the -m64 option.
Testing a patch (well, two).
just a note on the patch posted: http://gcc.gnu.org/ml/gcc-patches/2008-11/msg00407.html the fortran standard guarantees that E==TRANSFER(TRANSFER(E,D),E) if the physical representation of D and E is the same length. At the same time, it guarantees that a default logical and a default integer can be storage associated e.g. in a common block (talking about physical storage units). The wording seems somewhat imprecise, but I think it guarantees that the above transfer should work with integer and logical
Subject: Bug 35366 Author: jakub Date: Wed Nov 12 08:16:12 2008 New Revision: 141782 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=141782 Log: PR target/35366 * expr.c (expand_expr_addr_expr_1): If EXP needs bigger alignment than INNER and INNER is a constant, forcibly align INNER as much as needed. Modified: trunk/gcc/ChangeLog trunk/gcc/expr.c
Fixed, either of the patch is sufficient to fix it, though the other patch is still highly desirable.
Subject: Bug 35366 Author: jakub Date: Wed Nov 12 17:01:51 2008 New Revision: 141790 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=141790 Log: PR target/35366 PR fortran/33759 * fold-const.c (native_encode_string): New function. (native_encode_expr): Use it for STRING_CST. * trans-const.c (gfc_conv_constant_to_tree): Warn when converting an integer outside of LOGICAL's range to LOGICAL. * trans-intrinsic.c (gfc_conv_intrinsic_function, gfc_conv_intrinsic_array_transfer, gfc_conv_intrinsic_transfer): Use INTEGER_TYPE instead of BOOLEAN_TYPE for TRANSFER as argument of another TRANSFER. * gfortran.dg/hollerith.f90: Don't assume a 32-bit value stored into logical variable will be preserved. * gfortran.dg/transfer_simplify_4.f90: Remove undefined cases. Run at all optimization levels. Add a couple of new tests. * gfortran.dg/hollerith5.f90: New test. * gfortran.dg/hollerith_legacy.f90: Add dg-warning. Added: trunk/gcc/testsuite/gfortran.dg/hollerith5.f90 Modified: trunk/gcc/ChangeLog trunk/gcc/fold-const.c trunk/gcc/fortran/ChangeLog trunk/gcc/fortran/trans-const.c trunk/gcc/fortran/trans-intrinsic.c trunk/gcc/testsuite/ChangeLog trunk/gcc/testsuite/gfortran.dg/hollerith.f90 trunk/gcc/testsuite/gfortran.dg/hollerith_legacy.f90 trunk/gcc/testsuite/gfortran.dg/transfer_simplify_4.f90