public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "rguenth at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug tree-optimization/52019] New: [4.7 Regression] tree-ssa/ipa-split-5.c fails with -fno-tree-sra because of CLOBBERS
Date: Fri, 27 Jan 2012 14:58:00 -0000	[thread overview]
Message-ID: <bug-52019-4@http.gcc.gnu.org/bugzilla/> (raw)

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.


             reply	other threads:[~2012-01-27 14:36 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-01-27 14:58 rguenth at gcc dot gnu.org [this message]
2012-01-27 15:51 ` [Bug tree-optimization/52019] " rguenth at gcc dot gnu.org
2012-02-22 10:16 ` jakub at gcc dot gnu.org
2012-02-22 10:20 ` rguenther at suse dot de
2012-02-23 11:39 ` jakub at gcc dot gnu.org
2012-02-23 15:07 ` jakub at gcc dot gnu.org
2012-02-23 15:24 ` jakub at gcc dot gnu.org

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-52019-4@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).