This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Bugs in SSA-CCP and SSA-PRE optimizers


On Tue, 17 Sep 2002, Steven Bosscher wrote:

> main()					main()
> {					{
>   int bla;				  int bla;
>   int foo;				  int foo;
>   int bar;				  int bar;
>   int T.1;				  int T.1;
> 					> int pretmp.2;
>   bla = 1;				  bla = 1;
>   foo = bla * 2;		      |	  foo = pretmp.2 = 1 * 2;
>   T.1 = bla * 2;		      |	  T.1 = pretmp.2;
>   bar = T.1 + 1;			  bar = T.1 + 1;
>   goto waffle;				  goto waffle;
>   return bar;				  return bar;
>   waffle:				  waffle:
>   bla = 1;				  bla = 1;
>    return bar;				  return bar;
> }					}
> 
> Note the redundant assignment to T.1. It seems PRE doesn't kill those
> T.[0-9*] variables (both uses and it declarations). We're generating (a
> lot of?) useless RTL here.
>
The useless assignment to T.1 will not be detected by PRE.  You
need copy propagation for that.

> Also, why is "foo = pretmp.2 = 1 * 2" not folded?
> 
PRE should be folding expressions.  It should also be calling the
simplifier again, from what I can see.


Diego.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]