FAIL: g++.dg/tree-ssa/ivopts-1.C scan-tree-dump-not &x\[5\] FAIL: g++.dg/tree-ssa/ivopts-1.C scan-tree-dump-not offset: -4B appeared on mainline on hppa2.0w-hp-hpux11.11 and hppa64-hp-hpux11.11 when the test was added.
Mine. I'll add an XFAIL as for x86_64/i?86 - looks like hppa is another target with weird costs.
Fixed.
Subject: Bug 27707 Author: rguenth Date: Mon May 22 09:20:46 2006 New Revision: 113972 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=113972 Log: 2006-05-22 Richard Guenther <rguenther@suse.de> PR testsuite/27707 * g++.dg/tree-ssa/ivopts-1.C: XFAIL for hppa*-*-*. Modified: trunk/gcc/testsuite/ChangeLog trunk/gcc/testsuite/g++.dg/tree-ssa/ivopts-1.C
I would like to request that this bug to be reopened. First, the test never failed on hppa*-*-linux*, so we now have two XPASS's on this target. Second, between 15 and 17 August, the second xfail for hppa*-*-* changed to an XPASS on hppa*-*-hpux*. Third, there's no PR for the "-4B" offset that's still present on hppa*-*-hpux*. PR 26726, which added the testcase, points to PR target/24669 as the remaining issue for that issue. This is characterized as being a target specific problem, namely that the a more complicated addressing mode is cheaper than a simpler mode, leading ivopts to prefer the it. The puzzle in my mind is that there is no obvious difference between costs for hpux and linux in the PA backend.
I don't know what should be the difference between hpux and linux PA, though this is an issue of IVOPTs and rtl costs.
Subject: Re: g++.dg/tree-ssa/ivopts-1.C fails > I don't know what should be the difference between hpux and linux PA, though > this is an issue of IVOPTs and rtl costs. I've the dump files for hppa-unknown-linux-gnu and hppa2.0w-hp-hpux11.11. Dave
Created attachment 12213 [details] ivopts-1.C.085t.ivopts.linux
Created attachment 12214 [details] ivopts-1.C.085t.ivopts.hppa2.0w-hpux11
Subject: Re: g++.dg/tree-ssa/ivopts-1.C fails On Sat, 9 Sep 2006, dave at hiauly1 dot hia dot nrc dot ca wrote: > ------- Comment #7 from dave at hiauly1 dot hia dot nrc dot ca 2006-09-09 18:45 ------- > Subject: Re: g++.dg/tree-ssa/ivopts-1.C fails > > > I don't know what should be the difference between hpux and linux PA, though > > this is an issue of IVOPTs and rtl costs. > > I've the dump files for hppa-unknown-linux-gnu and hppa2.0w-hp-hpux11.11. It confirms that it is the same problem as on i?86, but it doesn't tell why. I don't see an obvious difference in config/pa/ Richard.
Subject: Re: g++.dg/tree-ssa/ivopts-1.C fails > It confirms that it is the same problem as on i?86, but it doesn't tell > why. I don't see an obvious difference in config/pa/ Yes, it does seem to be the same problem. The hpux assembler output has a -4 offset: stw %r2,-20(%r30) L$CFI0000 ldi 1,%r19 ldo 128(%r30),%r30 L$CFI0001 ldo -116(%r30),%r28 ldo -100(%r30),%r20 stw %r19,-4(%r28) L$0008: ldo 4(%r28),%r28 comb,<>,n %r20,%r28,L$0008 stw %r19,-4(%r28) .CALL ARGW0=GR bl _Z3fooR3Foo,%r2 ldo -120(%r30),%r26 The linux output doesn't have the -4 offset: ldi 1,%r28 stw %r2,-20(%r30) .LCFI0: copy %r28,%r21 ldo 128(%r30),%r30 .LCFI1: ldi 4,%r19 stw %r28,-120(%r30) ldo -120(%r30),%r26 ldi 16,%r20 .L2: addl %r19,%r26,%r28 ldo 4(%r19),%r19 comb,<> %r20,%r19,.L2 stw %r21,0(%r28) bl _Z3fooR3Foo,%r2 nop Offhand, then hpux code appears better optimized. Dave
Subject: Re: g++.dg/tree-ssa/ivopts-1.C fails > The linux output doesn't have the -4 offset: > > ldi 1,%r28 > stw %r2,-20(%r30) > .LCFI0: > copy %r28,%r21 > ldo 128(%r30),%r30 > .LCFI1: > ldi 4,%r19 > stw %r28,-120(%r30) > ldo -120(%r30),%r26 > ldi 16,%r20 > .L2: > addl %r19,%r26,%r28 > ldo 4(%r19),%r19 > comb,<> %r20,%r19,.L2 > stw %r21,0(%r28) > bl _Z3fooR3Foo,%r2 > nop It seems like the code generated for the hppa-unknown-linux-gnu target has been getting worse in each release since 4.0.0. Here is the 4.0.0 assembler code: stw %r2,-20(%r30) .LCFI0: ldi 1,%r19 ldo 128(%r30),%r30 .LCFI1: ldo -120(%r30),%r28 ldo -104(%r30),%r20 stw %r19,0(%r28) .L8: ldo 4(%r28),%r28 comb,<>,n %r28,%r20,.L8 stw %r19,0(%r28) bl _Z3fooR3Foo,%r2 ldo -120(%r30),%r26 In this code, the function prologue and loop setup are only six instructions. The loop is three instructions. The delay slot for the call to _Z3fooR3Foo is filled. The value loaded into r26 is the same as loaded into r28 before the loop. I would say this code is close to optimal aside from unrolling loop completely. Here is the code generated by Debian 4.1.1-13: stw %r2,-20(%r30) .LCFI0: ldi 0,%r19 ldo 128(%r30),%r30 .LCFI1: ldi 1,%r21 ldo -120(%r30),%r26 ldi 16,%r20 .L2: addl %r19,%r26,%r28 ldo 4(%r19),%r19 comb,<> %r20,%r19,.L2 stw %r21,0(%r28) bl _Z3fooR3Foo,%r2 nop The prologue and loop setup are still six instructions. However, the loop is now four instructions per iteration and we iterate one more time. Thus, we have a significant performance regression relative to 4.0.0 in the handling of this loop. Possibly, this results from the compiler trying to avoid loading the address "-120(%r30)" twice. However, the cost for loading small offsets is the same as doing a register copy. A register copy is just a ldo instruction with an offset of 0. The 4.2.0 code is worse than the 4.1.1 code in that the prologue and loop setup have now grown to eight instructions. However, we are back to three iterations. It seems like the compiler may be trying to avoid non-zero offsets. I don't know why this would be. hppa_address_cost is pretty simple. As far as the the difference between linux and hpux goes, the main difference is that long doubles are 64 bits on linux and 128 bits on hpux. This would affect the sizes of the cost arrays in expmed.c. I'm wondering if somehow some of the values in these tables are getting corrupted. There's one puzzling difference in the linux and hpux tree dumps. In the hpux dump, some variables are "long unsigned int" whereas in the linux dump they are "unsigned int". Dave
Will not be fixed in 4.2.0; retargeting at 4.2.1.
Change target milestone to 4.2.3, as 4.2.2 has been released.
4.2.3 is being released now, changing milestones of open bugs to 4.2.4.
Dave, is this test still failing on hppa? On the branch and trunk?
Subject: Re: g++.dg/tree-ssa/ivopts-1.C fails > Dave, is this test still failing on hppa? On the branch and trunk? It is not failing on either 4.2 or trunk. Checked hppa-unknown-linux-gnu, hppa2.0w-hp-hpux11.11 and hppa64-hp-hpux11.11. Dave
Thus fixed.
Subject: Re: g++.dg/tree-ssa/ivopts-1.C fails > Thus fixed. The test needs adjustment. Dave