This is the mail archive of the gcc-patches@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: [ipa-branch] Transforming IPCP to SSA


Diego Novillo <dnovillo@redhat.com> wrote on 18/02/2006 00:26:18:

> 
> Last time I checked this patch, it was just adding a constant assignment
> at the start of the function and allow the intraprocedural CCP deal with 
it.
> 
> How about secondary side-effects?  I believe those are the potentially
> interesting ones to handle.  The patch does not try to integrate inter
> and intra procedural CCP, so it wouldn't see things like this
> (admittedly contrived) example:
> 
> baz (int x)
> {
>   ...
> }
> 
> foo (int i)
> {
>   int j;
> 
>   if (i > 0)
>     j = i * 2;
>   else
>     j = i + 2;
> 
>   baz (j);
> }
> 
> main ()
> {
>   foo (2);
> }
> 
> In principle IPCP would not version baz(), right?  But, if you do
> version foo(), will we realize that we *always* call baz with x == 4?

No, we won't.
As you said, this requires interleaving of inter and intra procedural CCP.
This is not done currently.

Thanks,
Razya


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