Constant propagation and address arithmetic

2005-05-08 Thread Steven Bosscher
Hi, I have looked at the GCSE CPROP passes with CSE path following disabled ("-O1 -fgcse --param max-cse-path-length=1"). The input code are the cc1-i files from 20040726 (with checking enabled). Maybe not really a surprise: Roughly 2/3 of the constants that GCSE CPROP propagates are symbol_refs

Re: Constant propagation and address arithmetic

2005-05-08 Thread Richard Henderson
On Sun, May 08, 2005 at 04:33:28PM +0200, Steven Bosscher wrote: > Can we expose this kind of address arithmetic to the tree > optimizers? Should we? No and no. I've always believed that we'd be keeping an rtl gcse pass exactly for the reason of address arithmetic. r~

Re: Constant propagation and address arithmetic

2005-05-08 Thread Steven Bosscher
On Sunday 08 May 2005 22:19, Richard Henderson wrote: > On Sun, May 08, 2005 at 10:06:04PM +0200, Steven Bosscher wrote: > > A test case that shows what is going on is this: > > > > extern char *x; > > void > > foo (char *a, char *b) > > { > > if (!x) > > x = a; > > else > > x = b; > >

Re: Constant propagation and address arithmetic

2005-05-08 Thread Richard Henderson
On Sun, May 08, 2005 at 10:06:04PM +0200, Steven Bosscher wrote: > A test case that shows what is going on is this: > > extern char *x; > void > foo (char *a, char *b) > { > if (!x) > x = a; > else > x = b; > } This test case doesn't show anything. .04.cse merges all the high parts o

Re: Constant propagation and address arithmetic

2005-05-08 Thread Steven Bosscher
On Sunday 08 May 2005 21:00, Richard Henderson wrote: > On Sun, May 08, 2005 at 04:33:28PM +0200, Steven Bosscher wrote: > > Can we expose this kind of address arithmetic to the tree > > optimizers? Should we? > > No and no. Clear enough :-) > I've always believed that we'd be keeping an rtl gcs

Re: Constant propagation and address arithmetic

2005-05-08 Thread Richard Henderson
On Sun, May 08, 2005 at 10:26:19PM +0200, Steven Bosscher wrote: > Oops. Not a modified tree, non-standard command line options: > -O -fgcse --param max-cse-path-length=1 Ah, I see. Well, I think this is a misfeature of gcse in how it decides how to update expressions. With a bit more thought w

Re: Constant propagation and address arithmetic

2005-05-08 Thread Daniel Berlin
On Sun, 2005-05-08 at 14:24 -0700, Richard Henderson wrote: > On Sun, May 08, 2005 at 10:26:19PM +0200, Steven Bosscher wrote: > > Oops. Not a modified tree, non-standard command line options: > > -O -fgcse --param max-cse-path-length=1 > > Ah, I see. Well, I think this is a misfeature of gcse i

Re: Constant propagation and address arithmetic

2005-05-09 Thread tbp
On 5/8/05, Steven Bosscher <[EMAIL PROTECTED]> wrote: > Hi, Hello, > I have looked at the GCSE CPROP passes with CSE path following > disabled ("-O1 -fgcse --param max-cse-path-length=1"). The input > code are the cc1-i files from 20040726 (with checking enabled). While that discussion flies way