User account creation filtered due to spam.

Bug 35359

Summary: Conservative aliasing related unmodified formals
Product: gcc Reporter: davidxl <xinliangli>
Component: middle-endAssignee: Not yet assigned to anyone <unassigned>
Status: RESOLVED DUPLICATE    
Severity: enhancement CC: gcc-bugs, pinskia, xinliangli
Priority: P3 Keywords: alias, missed-optimization
Version: 4.3.0   
Target Milestone: ---   
Host: Target:
Build: Known to work:
Known to fail: Last reconfirmed: 2008-02-25 11:41:22

Description davidxl 2008-02-25 05:17:53 UTC
Unmodified formals can not point to local variables. It is NOT treated so in GCC:

Example:

void bar(int* );
int foo(int* p, int *q)
{
   int local, i;
   bar(&local);

   for(i = 0; i < 100; i++)
   {
       *q += local;    // local, *q not hoisted, *q = not sinked
   }

   return local;
}
Comment 1 Richard Biener 2008-02-25 11:41:22 UTC
We think q may now point to local as that escapes through bar.
Comment 2 davidxl 2008-02-25 17:24:14 UTC
(In reply to comment #1)
> We think q may now point to local as that escapes through bar.
> 

And that is why it is conservative.
Comment 3 Andrew Pinski 2008-02-25 18:03:14 UTC

*** This bug has been marked as a duplicate of 23086 ***