http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48590

           Summary: Alias analysis confused by builtin-stack-save/restore
           Product: gcc
           Version: 4.7.0
            Status: UNCONFIRMED
          Severity: enhancement
          Priority: P3
         Component: middle-end
        AssignedTo: unassig...@gcc.gnu.org
        ReportedBy: rgue...@gcc.gnu.org


Lame testcase for now:

float foo (int i, double *d)
{
  float f;
  double dd;
  int j;
  dd = *d;
  for (j = 0; j<i; ++j)
    {
      float a[i];
    f+=a[j] + *d + dd;
    }
  return f;
}

we fail to CSE *d because we think that __builtin_stack_save () clobbers it.
__builtin_stack_restore () has similar effects on DSE (it appears to use
all aliased memory).

We have to be careful when improving this to not allow sinking operations
on alloca'd memory over a __builtin_stack_restore ().

Reply via email to