This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Fix PR54240
- From: Andrew Pinski <pinskia at gmail dot com>
- To: "William J. Schmidt" <wschmidt at linux dot vnet dot ibm dot com>
- Cc: gcc-patches at gcc dot gnu dot org, bergner at vnet dot ibm dot com, rguenther at suse dot de
- Date: Tue, 14 Aug 2012 14:15:47 -0700
- Subject: Re: [PATCH] Fix PR54240
- References: <1344978713.31850.6.camel@gnopaine>
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" } */
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" } } */