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/14187] New: [tree-ssa] restricted pointers should not alias


Given:
extern void link_error (void);

void bar0 (int * __restrict__ arr1, int * __restrict__ arr2)
{
  arr1[0] = 1;
  arr2[0] = 1;
  if (arr1[0] != 1)
    link_error ();
}

arr1 and arr2 should not alias, hence the "if" should be eliminated

The .optimized dump is: 

bar0 (arr1, arr2)
{
<bb 0>:
  #   TMT.46_5 = VDEF <TMT.46_4>;
  *arr1 = 1;
  #   TMT.46_6 = VDEF <TMT.46_5>;
  *arr2 = 1;
  if (*arr1 != 1) goto <L0>; else goto <L1>;

<L0>:;
  #   TMT.46_7 = VDEF <TMT.46_6>;
  link_error ();

<L1>:;
  return;

}

-- 
           Summary: [tree-ssa] restricted pointers should not alias
           Product: gcc
           Version: unknown
            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=14187


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