public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "rguenth at gcc dot gnu dot org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug tree-optimization/19431] missed optimization with ifs and deferencing
Date: Sun, 25 Feb 2007 22:50:00 -0000	[thread overview]
Message-ID: <20070225225010.32196.qmail@sourceware.org> (raw)
In-Reply-To: <bug-19431-6528@http.gcc.gnu.org/bugzilla/>



------- Comment #15 from rguenth at gcc dot gnu dot org  2007-02-25 22:50 -------
We start with

  D.59982_3 = variable_2(D) + 4B;
  __unary_op = __unary_op.65;
  goto <bb 4> (<L1>);

<L0>:;
  D.61146_10 = __unary_op._M_arg1;
  D.61147_11 = __unary_op._M_arg2;
  D.61093_12 = D.61146_10 + D.61147_11;
  *variable_13 = D.61093_12;
  variable_14 = variable_7 + 4B;
  variable_15 = variable_13 + 4B;

  # variable_7 = PHI <variable_2(D)(2), variable_14(3)>
  # variable_13 = PHI <variable_2(D)(2), variable_15(3)>
<L1>:;
  if (D.59982_3 != variable_7) goto <L0>; else goto <L2>;

and loop header copying and DOM make it optimizable:

  D.59982_3 = variable_2(D) + 4B;
  __unary_op.65._M_arg2 = v_1(D);
  __unary_op.65._M_arg1 = 0;
  __unary_op = __unary_op.65;
  __unary_op$_M_arg2_54 = __unary_op._M_arg2;
  __unary_op$_M_arg1_53 = __unary_op._M_arg1;
  if (variable_2(D) != D.59982_3) goto <L7>; else goto <L2>;

<L2>:;
  return;

  # variable_49 = PHI <variable_2(D)(2)>
  # variable_27 = PHI <variable_2(D)(2)>
<L7>:;
  __unary_op$_M_arg1_25 = __unary_op$_M_arg1_53;
  __unary_op$_M_arg2_17 = __unary_op$_M_arg2_54;
  D.61093_18 = __unary_op$_M_arg1_53 + __unary_op$_M_arg2_54;
  *variable_49 = D.61093_18;
  variable_20 = variable_27 + 4B;
  variable_21 = variable_49 + 4B;
  goto <bb 3> (<L2>);

so a tweaked forwprop fixes it at least before PRE.  But dunno if we want
to do tree combining on conditions here.


-- 


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


  parent reply	other threads:[~2007-02-25 22:50 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <bug-19431-6528@http.gcc.gnu.org/bugzilla/>
2006-02-05 15:37 ` pinskia at gcc dot gnu dot org
2006-12-19 21:16 ` pinskia at gcc dot gnu dot org
2006-12-20  9:58 ` steven at gcc dot gnu dot org
2007-02-09 14:46 ` pinskia at gcc dot gnu dot org
2007-02-09 14:48 ` rguenth at gcc dot gnu dot org
2007-02-25 19:00 ` pluto at agmk dot net
2007-02-25 19:52 ` rguenth at gcc dot gnu dot org
2007-02-25 20:09 ` pluto at agmk dot net
2007-02-25 22:01 ` pinskia at gcc dot gnu dot org
2007-02-25 22:23 ` rguenth at gcc dot gnu dot org
2007-02-25 22:50 ` rguenth at gcc dot gnu dot org [this message]
2007-02-25 22:51 ` rguenth at gcc dot gnu dot org
2007-02-26 10:33 ` rguenth at gcc dot gnu dot org
2007-04-18 11:45 ` rguenth at gcc dot gnu dot org
2007-04-18 11:48 ` rguenth at gcc dot gnu dot org
2007-04-18 12:02 ` pluto at agmk dot net
2007-04-18 13:45 ` rguenth at gcc dot gnu dot org
2007-04-18 18:18 ` pluto at agmk dot net
2007-04-18 18:21 ` pinskia at gcc dot gnu dot org
2005-01-13 21:38 [Bug tree-optimization/19431] New: " pinskia at gcc dot gnu dot org
2005-01-13 21:42 ` [Bug tree-optimization/19431] " steven at gcc dot gnu dot org
2005-01-13 21:43 ` pinskia at gcc dot gnu dot org
2005-01-13 21:54 ` pinskia at gcc dot gnu dot org
2005-01-14 13:32 ` pinskia at gcc dot gnu dot org
2005-01-15  0:22 ` dberlin at dberlin dot 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=20070225225010.32196.qmail@sourceware.org \
    --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).