public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "rguenther at suse dot de" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug tree-optimization/37242] missed FRE opportunity because of signedness of addition
Date: Wed, 27 Aug 2008 19:13:00 -0000	[thread overview]
Message-ID: <20080827191222.8992.qmail@sourceware.org> (raw)
In-Reply-To: <bug-37242-7849@http.gcc.gnu.org/bugzilla/>



------- Comment #9 from rguenther at suse dot de  2008-08-27 19:12 -------
Subject: Re:  missed FRE opportunity because of
 signedness of addition

On Wed, 27 Aug 2008, bonzini at gnu dot org wrote:

> ------- Comment #8 from bonzini at gnu dot org  2008-08-27 17:50 -------
> Subject: Re:  missed FRE opportunity because
>  of signedness of addition
> 
> Maybe we can lookup the non-GIMPLE operands in simplify_unary_expression
> and replace them with existing SSA_NAMES if they have been value numbered.

So when we see

pretmp.36_86 = (unsigned int) maxIdx_24;

we do not even simplify it to (unsigned int)maxIdx_59 + 1.

So much for the fold theory...  instead we come from

#9  0x080b75dd in pointer_int_sum (resultcode=PLUS_EXPR, ptrop=0xb7c9d57c, 
    intop=0xb7ca37a0) at /home/richard/src/trunk/gcc/c-common.c:3361
3361      ret = fold_build2 (POINTER_PLUS_EXPR, result_type, ptrop, 
intop);
(gdb) call debug_generic_expr (ptrop)
y + 4
(gdb) call debug_generic_expr (intop)
(unsigned int) ((unsigned int) x * 4)

go through y p+ (4 + (unsigned int) ((unsigned int) x * 4)) which we
fold by fold_plusminus_mult_expr to ((unsigned int) x + 1) * 4.

I saw your patch that adds this folding.  And indeed we should
be able to lookup (unsigned int) x + 1 in two steps.

I may look into this at some point.

Richard.


-- 


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


  parent reply	other threads:[~2008-08-27 19:13 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-08-26 11:55 [Bug tree-optimization/37242] New: missed load PRE-like opportunity bonzini at gnu dot org
2008-08-26 11:57 ` [Bug tree-optimization/37242] " bonzini at gnu dot org
2008-08-26 12:03 ` [Bug tree-optimization/37242] missed FRE opportunity bonzini at gnu dot org
2008-08-26 21:17 ` [Bug tree-optimization/37242] missed FRE opportunity because of signedness of addition pinskia at gcc dot gnu dot org
2008-08-27  6:42 ` bonzini at gnu dot org
2008-08-27  7:16 ` bonzini at gnu dot org
2008-08-27  7:16 ` bonzini at gnu dot org
2008-08-27  9:42 ` rguenther at suse dot de
2008-08-27 17:51 ` bonzini at gnu dot org
2008-08-27 19:13 ` rguenther at suse dot de [this message]
2008-08-27 19:55 ` bonzini at gnu dot org
2008-08-27 20:18 ` rguenther at suse dot de
2008-08-28  6:10 ` bonzini at gnu dot org
2008-08-28  6:18 ` bonzini at gnu dot org
2008-08-28  8:03 ` rguenther at suse dot de
2008-08-28  8:43 ` bonzini at gnu dot org
2008-08-28  8:47 ` rguenther at suse dot de
2008-08-28  8:58 ` bonzini at gnu dot org
2008-08-28  8:59 ` bonzini at gnu dot org
2008-08-29  4:39 ` pinskia at gcc dot gnu dot org
     [not found] <bug-37242-4@http.gcc.gnu.org/bugzilla/>
2011-04-27 17:57 ` matt at use dot net
2011-04-28  9:53 ` rguenth at gcc dot gnu.org
2012-04-18 22:51 ` pinskia at gcc dot gnu.org
2012-06-29  0:20 ` matt at use dot net

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=20080827191222.8992.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).