This is the mail archive of the gcc-bugs@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]

[Bug optimization/13762] New: [tree-ssa] stores to different members of the same array should not alias


int foo (int * arr)
{
  arr[0] = 1;
  arr[1] = 2;
  if (arr[0] != 1)
    abort ();
  if (arr[1] = 2)
    abort ();
}


The first if is not optimized away because, presumably, the 2 stores are not
considered not to alias.

Also strange is that the second store is performed twice.

The .optimized dump:

foo (arr)
{
  int * T.1;

<bb 0>:
  *arr = 1;
  T.1 = arr + 4B;
  *T.1 = 2;
  if (*arr != 1) goto <L0>; else goto <L1>;

<L0>:;
  abort ();

<L1>:;
  *T.1 = 2;
  abort ();

}

-- 
           Summary: [tree-ssa] stores to different members of the same array
                    should not alias
           Product: gcc
           Version: tree-ssa
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: optimization
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: dann at godzilla dot ics dot uci dot edu
                CC: gcc-bugs at gcc dot gnu dot org


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


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