https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65342
Bug ID: 65342 Summary: [5 Regression] FAIL: gfortran.dg/intrinsic_(un)?pack_1.f90 -O1 execution test on powerpc-apple-darwin9 after r210201 Product: gcc Version: 5.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: target Assignee: unassigned at gcc dot gnu.org Reporter: dominiq at lps dot ens.fr CC: amodra at gcc dot gnu.org, iains at gcc dot gnu.org Host: powerpc-apple-darwin9 Target: powerpc-apple-darwin9 Build: powerpc-apple-darwin9 On powerpc-apple-darwin9 I see the following failures with -m64 after r210201 FAIL: gfortran.dg/intrinsic_pack_1.f90 -O1 execution test FAIL: gfortran.dg/intrinsic_pack_1.f90 -O2 execution test FAIL: gfortran.dg/intrinsic_unpack_1.f90 -O1 execution test FAIL: gfortran.dg/intrinsic_unpack_1.f90 -O2 execution test FAIL: gfortran.dg/intrinsic_unpack_1.f90 -O3 -fomit-frame-pointer execution test FAIL: gfortran.dg/intrinsic_unpack_1.f90 -O3 -fomit-frame-pointer -funroll-loops execution test FAIL: gfortran.dg/intrinsic_unpack_1.f90 -O3 -fomit-frame-pointer -funroll-all-loops -finline-functions execution test FAIL: gfortran.dg/intrinsic_unpack_1.f90 -O3 -g execution test The failures occur only in the following reduced codes program intrinsic_unpack implicit none integer(kind=2), dimension(3, 3) :: a2, b2 logical, dimension(3, 3) :: mask character(len=500) line1, line2 integer i mask = reshape ((/.false.,.true.,.false.,.true.,.false.,.false.,& &.false.,.false.,.true./), (/3, 3/)); a2 = reshape ((/1, 0, 0, 0, 1, 0, 0, 0, 1/), (/3, 3/)); b2 = unpack ((/2_2, 3_2, 4_2/), mask, a2) print *, b2 if (any (b2 .ne. reshape ((/1, 2, 0, 3, 1, 0, 0, 0, 4/), (/3, 3/)))) & call abort end program program main implicit none integer :: i integer(kind=2), dimension(3,3) :: i2 integer(kind=2), dimension(9) :: vi2 integer(kind=2), dimension(9) :: ri2 vi2 = (/(i+10,i=1,9)/) i2 = reshape((/1_2, -1_2, 2_2, -2_2, 3_2, -3_2, 4_2, -4_2, 5_2/), shape(i2)) ri2 = pack(i2,i2>0,vi2) if (any(ri2 /= (/1_2, 2_2, 3_2, 4_2, 5_2, 16_2, 17_2, 18_2, 19_2/))) & & call abort end program main all the other checks in the original tests succeed. The difference between the assembly generated by r210200 (-) and r210201 (+) is --- intrinsic_unpack_1_red.s 2015-03-07 10:11:12.000000000 +0100 +++ intrinsic_unpack_1_red_b.s 2015-03-07 10:10:46.000000000 +0100 @@ -26,18 +26,14 @@ L1$pb: std r10,172(r1) lwz r2,32(r2) stw r2,180(r1) - addis r9,r31,ha16(_A.1.1600-L1$pb) - la r2,lo16(_A.1.1600-L1$pb)(r9) - lwz r7,lo16(_A.1.1600-L1$pb)(r9) - lwz r8,4(r2) - lwz r10,8(r2) - lwz r9,12(r2) - stw r7,112(r1) - stw r8,116(r1) - stw r10,120(r1) - stw r9,124(r1) - lhz r2,16(r2) - sth r2,128(r1) + addis r2,r31,ha16(_A.1.1600-L1$pb) + la r9,lo16(_A.1.1600-L1$pb)(r2) + ld r2,lo16(_A.1.1600-L1$pb)(r2) + ld r10,8(r9) + lhz r9,16(r9) + std r2,112(r1) + std r10,120(r1) + sth r9,128(r1) li r25,138 std r25,752(r1) li r30,1