public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "amylaar at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug middle-end/59049] Two VOIDmode constant in comparison passed to cstoresi4
Date: Mon, 11 Nov 2013 10:47:00 -0000	[thread overview]
Message-ID: <bug-59049-4-VGTAZSJHAj@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-59049-4@http.gcc.gnu.org/bugzilla/>

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

--- Comment #8 from Jorn Wolfgang Rennecke <amylaar at gcc dot gnu.org> ---
(In reply to Richard Biener from comment #7)
> That is, sth like
> 
> Index: gcc/tree-ssa-ter.c
> ===================================================================
> --- gcc/tree-ssa-ter.c  (revision 204664)
> +++ gcc/tree-ssa-ter.c  (working copy)
> @@ -438,6 +439,12 @@ ter_is_replaceable_p (gimple stmt)
>           && !is_gimple_val (gimple_assign_rhs1 (stmt)))
>         return false;
>  
> +      /* Do not propagate "modeless" constants - we may end up confusing
> the RTL
> +        expanders.  Leave the optimization to RTL CCP.  */
> +      if (gimple_assign_single_p (stmt)
> +         && CONSTANT_CLASS_P (gimple_assign_rhs1 (stmt)))
> +       return false;
> +
>        return true;
>      }
>    return false;

Constants are often very valuable for rtl expansion, allowing to use
cheaper patterns.
And some constant propagations are impossible in rtl because of mode
oddities.  E.g. when you have a have a mulsidi3 pattern, you generally
have a sign_extend - you can't have a VOIDmode constant inside that.
Therefore, I would rather have the middle-end move the constants
to registers only when necessary to preserve the mode, and preferrably
fold instead in the first place when optimizing.


  parent reply	other threads:[~2013-11-11 10:47 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-11-08 13:16 [Bug middle-end/59049] New: " amylaar at gcc dot gnu.org
2013-11-08 16:27 ` [Bug middle-end/59049] " amylaar at gcc dot gnu.org
2013-11-08 16:56 ` amylaar at gcc dot gnu.org
2013-11-09 23:20 ` pinskia at gcc dot gnu.org
2013-11-11 10:13 ` amylaar at gcc dot gnu.org
2013-11-11 10:19 ` rguenth at gcc dot gnu.org
2013-11-11 10:28 ` rguenth at gcc dot gnu.org
2013-11-11 10:47 ` amylaar at gcc dot gnu.org [this message]
2013-11-11 18:58 ` amylaar at gcc dot gnu.org
2014-04-11 14:45 ` amylaar 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-59049-4-VGTAZSJHAj@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).