Re: [RFA][PATCH][pr target/60648] Fix non-canonical RTL from x86 backend -- P1 regression

2014-03-29 Thread Andreas Schwab
Jeff Law writes: > diff --git a/gcc/testsuite/g++.dg/pr60648.C b/gcc/testsuite/g++.dg/pr60648.C > new file mode 100644 > index 000..80c0561 > --- /dev/null > +++ b/gcc/testsuite/g++.dg/pr60648.C > @@ -0,0 +1,73 @@ > +/* { dg-do compile } */ > +/* { dg-do compile { target i?86-*-* x86_64-*-* }

Re: [RFA][PATCH][pr target/60648] Fix non-canonical RTL from x86 backend -- P1 regression

2014-03-29 Thread Jakub Jelinek
On Fri, Mar 28, 2014 at 07:12:26PM +0100, Jakub Jelinek wrote: > On Fri, Mar 28, 2014 at 12:04:00PM -0600, Jeff Law wrote: > > Here's the updated patch. It uses simplify_gen_binary in expr.c to > > simplify the address expression as we're building it. It also uses > > copy_addr_to_reg in the x86

Re: [RFA][PATCH][pr target/60648] Fix non-canonical RTL from x86 backend -- P1 regression

2014-03-28 Thread Jakub Jelinek
On Fri, Mar 28, 2014 at 12:04:00PM -0600, Jeff Law wrote: > Here's the updated patch. It uses simplify_gen_binary in expr.c to > simplify the address expression as we're building it. It also uses > copy_addr_to_reg in the x86 backend to avoid the possibility of > generating non-canonical RTL ther

Re: [RFA][PATCH][pr target/60648] Fix non-canonical RTL from x86 backend -- P1 regression

2014-03-28 Thread Jeff Law
On 03/26/14 12:28, Jakub Jelinek wrote: On Wed, Mar 26, 2014 at 12:17:43PM -0600, Jeff Law wrote: On 03/26/14 12:12, Jakub Jelinek wrote: On Wed, Mar 26, 2014 at 11:02:48AM -0600, Jeff Law wrote: Bootstrapped and regression tested on x86_64-unknown-linux-gnu. Verified it fixes the original and

Re: [RFA][PATCH][pr target/60648] Fix non-canonical RTL from x86 backend -- P1 regression

2014-03-27 Thread Jakub Jelinek
On Thu, Mar 27, 2014 at 10:17:26AM -0600, Jeff Law wrote: > >Did you mean Jeff's original change, or say: > >--- gcc/config/i386/i386.c 2014-03-20 17:41:45.917689676 +0100 > >+++ gcc/config/i386/i386.c 2014-03-27 14:47:21.876254288 +0100 > >@@ -13925,13 +13925,13 @@ ix86_legitimize_address (rtx

Re: [RFA][PATCH][pr target/60648] Fix non-canonical RTL from x86 backend -- P1 regression

2014-03-27 Thread Jeff Law
On 03/27/14 07:51, Jakub Jelinek wrote: On Wed, Mar 26, 2014 at 09:53:47PM +, Richard Sandiford wrote: Richard Henderson writes: On 03/26/2014 12:40 PM, Jakub Jelinek wrote: On Wed, Mar 26, 2014 at 01:32:44PM -0600, Jeff Law wrote: On 03/26/14 12:28, Jakub Jelinek wrote: (mult:SI (const

Re: [RFA][PATCH][pr target/60648] Fix non-canonical RTL from x86 backend -- P1 regression

2014-03-27 Thread Jeff Law
On 03/26/14 15:53, Richard Sandiford wrote: Richard Henderson writes: On 03/26/2014 12:40 PM, Jakub Jelinek wrote: On Wed, Mar 26, 2014 at 01:32:44PM -0600, Jeff Law wrote: On 03/26/14 12:28, Jakub Jelinek wrote: (mult:SI (const_int 0) (const_int 4)) is IMHO far from being canonical. And, I'

Re: [RFA][PATCH][pr target/60648] Fix non-canonical RTL from x86 backend -- P1 regression

2014-03-27 Thread Richard Henderson
On 03/27/2014 06:51 AM, Jakub Jelinek wrote: > Did you mean Jeff's original change, or say: > --- gcc/config/i386/i386.c2014-03-20 17:41:45.917689676 +0100 > +++ gcc/config/i386/i386.c2014-03-27 14:47:21.876254288 +0100 > @@ -13925,13 +13925,13 @@ ix86_legitimize_address (rtx x, rtx oldx >

Re: [RFA][PATCH][pr target/60648] Fix non-canonical RTL from x86 backend -- P1 regression

2014-03-27 Thread Jakub Jelinek
On Wed, Mar 26, 2014 at 09:53:47PM +, Richard Sandiford wrote: > Richard Henderson writes: > > On 03/26/2014 12:40 PM, Jakub Jelinek wrote: > >> On Wed, Mar 26, 2014 at 01:32:44PM -0600, Jeff Law wrote: > >>> On 03/26/14 12:28, Jakub Jelinek wrote: > (mult:SI (const_int 0) (const_int 4))

Re: [RFA][PATCH][pr target/60648] Fix non-canonical RTL from x86 backend -- P1 regression

2014-03-26 Thread Richard Sandiford
Richard Henderson writes: > On 03/26/2014 12:40 PM, Jakub Jelinek wrote: >> On Wed, Mar 26, 2014 at 01:32:44PM -0600, Jeff Law wrote: >>> On 03/26/14 12:28, Jakub Jelinek wrote: (mult:SI (const_int 0) (const_int 4)) is IMHO far from being canonical. And, I'd say it is likely other target

Re: [RFA][PATCH][pr target/60648] Fix non-canonical RTL from x86 backend -- P1 regression

2014-03-26 Thread Richard Henderson
On 03/26/2014 12:40 PM, Jakub Jelinek wrote: > On Wed, Mar 26, 2014 at 01:32:44PM -0600, Jeff Law wrote: >> On 03/26/14 12:28, Jakub Jelinek wrote: >>> (mult:SI (const_int 0) (const_int 4)) is IMHO far from being canonical. >>> And, I'd say it is likely other target legitimization hooks would also

Re: [RFA][PATCH][pr target/60648] Fix non-canonical RTL from x86 backend -- P1 regression

2014-03-26 Thread Mike Stump
On Mar 26, 2014, at 11:33 AM, Jeff Law wrote: > On 03/26/14 12:28, Jakub Jelinek wrote: >> On Wed, Mar 26, 2014 at 12:17:43PM -0600, Jeff Law wrote: >>> On 03/26/14 12:12, Jakub Jelinek wrote: On Wed, Mar 26, 2014 at 11:02:48AM -0600, Jeff Law wrote: > Bootstrapped and regression tested o

Re: [RFA][PATCH][pr target/60648] Fix non-canonical RTL from x86 backend -- P1 regression

2014-03-26 Thread Jakub Jelinek
On Wed, Mar 26, 2014 at 01:32:44PM -0600, Jeff Law wrote: > On 03/26/14 12:28, Jakub Jelinek wrote: > >(mult:SI (const_int 0) (const_int 4)) is IMHO far from being canonical. > >And, I'd say it is likely other target legitimization hooks would also try > >to simplify it similarly. > >simplify_gen_b

Re: [RFA][PATCH][pr target/60648] Fix non-canonical RTL from x86 backend -- P1 regression

2014-03-26 Thread Jeff Law
On 03/26/14 12:28, Jakub Jelinek wrote: (mult:SI (const_int 0) (const_int 4)) is IMHO far from being canonical. And, I'd say it is likely other target legitimization hooks would also try to simplify it similarly. simplify_gen_binary is used in several other places during expansion, so I don't see

Re: [RFA][PATCH][pr target/60648] Fix non-canonical RTL from x86 backend -- P1 regression

2014-03-26 Thread Jakub Jelinek
On Wed, Mar 26, 2014 at 12:17:43PM -0600, Jeff Law wrote: > On 03/26/14 12:12, Jakub Jelinek wrote: > >On Wed, Mar 26, 2014 at 11:02:48AM -0600, Jeff Law wrote: > >>Bootstrapped and regression tested on x86_64-unknown-linux-gnu. > >>Verified it fixes the original and reduced testcase. > > > >Note,

Re: [RFA][PATCH][pr target/60648] Fix non-canonical RTL from x86 backend -- P1 regression

2014-03-26 Thread Jeff Law
On 03/26/14 12:28, Jakub Jelinek wrote: On Wed, Mar 26, 2014 at 12:17:43PM -0600, Jeff Law wrote: On 03/26/14 12:12, Jakub Jelinek wrote: On Wed, Mar 26, 2014 at 11:02:48AM -0600, Jeff Law wrote: Bootstrapped and regression tested on x86_64-unknown-linux-gnu. Verified it fixes the original and

Re: [RFA][PATCH][pr target/60648] Fix non-canonical RTL from x86 backend -- P1 regression

2014-03-26 Thread Jeff Law
On 03/26/14 12:12, Jakub Jelinek wrote: On Wed, Mar 26, 2014 at 11:02:48AM -0600, Jeff Law wrote: Bootstrapped and regression tested on x86_64-unknown-linux-gnu. Verified it fixes the original and reduced testcase. Note, the testcase is missing from your patch. But I'd question if this is the

Re: [RFA][PATCH][pr target/60648] Fix non-canonical RTL from x86 backend -- P1 regression

2014-03-26 Thread Jakub Jelinek
On Wed, Mar 26, 2014 at 11:02:48AM -0600, Jeff Law wrote: > Bootstrapped and regression tested on x86_64-unknown-linux-gnu. > Verified it fixes the original and reduced testcase. Note, the testcase is missing from your patch. But I'd question if this is the right place to canonicalize it. The non

[RFA][PATCH][pr target/60648] Fix non-canonical RTL from x86 backend -- P1 regression

2014-03-26 Thread Jeff Law
The x86 backend can generate non-canonical RTL when it simplifies address expressions. In particular addresses which have the form (plus (mult) (A) (B) (label_ref)) If the multiplication can be simplified to a constant, the x86 backend will end up generating (plus (constant) (label_ref))