[PATCH] Fix PR54240
Andrew Pinski
pinskia@gmail.com
Tue Aug 14 21:17:00 GMT 2012
On Tue, Aug 14, 2012 at 2:15 PM, Andrew Pinski <pinskia@gmail.com> wrote:
> On Tue, Aug 14, 2012 at 2:11 PM, William J. Schmidt
> <wschmidt@linux.vnet.ibm.com> wrote:
>> Replace the once vacuously true, and now vacuously false, test for
>> existence of a conditional move instruction for a given mode, with one
>> that actually checks what it's supposed to. Add a test case so we don't
>> miss such things in future.
>>
>> The test is powerpc-specific. It would be good to have an i386 version
>> of the test as well, if someone can help with that.
>>
>> Bootstrapped and tested on powerpc64-unknown-linux-gnu with no new
>> regressions. Ok for trunk?
>
> Here is one which can go into gcc.target/mips :
> /* { dg-do compile } */
> /* { dg-options "-O2 -fdump-tree-phiopt-details" } */
Sorry the dg-options should be:
/* { dg-options "-O2 -fdump-tree-phiopt-details isa>=4" } */
Thanks,
Andrew
>
> typedef struct s {
> int v;
> int b;
> struct s *l;
> struct s *r;
> } S;
>
>
> int foo(S *s)
> {
> S *this;
> S *next;
>
> this = s;
> if (this->b)
> next = this->l;
> else
> next = this->r;
>
> return next->v;
> }
>
> /* { dg-final { scan-tree-dump "Hoisting adjacent loads" "phiopt1" } } */
> /* { dg-final { cleanup-tree-dump "phiopt1" } } */
More information about the Gcc-patches
mailing list