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 tree-optimization/52019] New: [4.7 Regression] tree-ssa/ipa-split-5.c fails with -fno-tree-sra because of CLOBBERS


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

             Bug #: 52019
           Summary: [4.7 Regression] tree-ssa/ipa-split-5.c fails with
                    -fno-tree-sra because of CLOBBERS
    Classification: Unclassified
           Product: gcc
           Version: 4.7.0
            Status: UNCONFIRMED
          Keywords: missed-optimization
          Severity: normal
          Priority: P3
         Component: tree-optimization
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: rguenth@gcc.gnu.org


IPA split is confused by the stale clobber in BB 5:

<bb 2>:
  D.1717_2 = a_1(D) != 0;
  D.1718_3 = (long int) D.1717_2;
  D.1719_4 = __builtin_expect (D.1718_3, 1);
  if (D.1719_4 != 0)
    goto <bb 3>;
  else
    goto <bb 4>;

<bb 3>:
  D.1722.a = 0;
  D.1722.b = 0;
  goto <bb 5>;

<bb 4>:
  retval = make_me_big (a_1(D));
  retval = make_me_big (a_1(D));
  retval = make_me_big (a_1(D));
  retval = make_me_big (a_1(D));
  retval = make_me_big (a_1(D));
  retval = make_me_big (a_1(D));
  D.1722 = retval;
  retval ={v} {CLOBBER};

<bb 5>:
  retval ={v} {CLOBBER};
  return D.1722;


As you can see 'retval' is completely unused on the path to BB5.  We
should arrange for them to be removed in such cases, maybe by DCE.

This blocks SRA from not "scalarizing" clobbers, which it does like:

<bb 5>:
  retval$a_21 = 0;
  retval$b_22 = 0;
  return D.1722;

which is sort-of bogus anyway.

I'll fixup SRA, but for SRA to do this trick there needs to be stmts
that touch retval in any meaningful way, so a clobber that is stale
before SRA will stay so.


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