public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "gcc-bugzilla at mkarcher dot dialup.fu-berlin.de" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug target/63783] [4.9/5 Regression] [SH] Miscompilation of boolean negation on SH4 using -O2
Date: Sun, 16 Nov 2014 18:54:00 -0000	[thread overview]
Message-ID: <bug-63783-4-Ba0FeRBjBd@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-63783-4@http.gcc.gnu.org/bugzilla/>

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63783

--- Comment #12 from Michael Karcher <gcc-bugzilla at mkarcher dot dialup.fu-berlin.de> ---
Further digging into this showed that there actually is a pass that would merge
the two "tst r1,r1" instructions - the jump2 pass in cfgclenup.c.

The optimization is called "crossjumping" in gcc, also known as tail merging.
For some reason[1], gcc is reluctant to perform crossjumping on small common
parts. In this case, the common part is just one instruction, and the parameter
min-crossjump-insns is five by default unless optimizing for size. With
"-fparam-min-crossjump-insns=1" or "-Os", my first patch removing all the
special-casing of zero compares produces the same result as the patch fixing
the logical negations. In the current situation, I see no advantage of not
cross-jumping in this case, so the minimally invasive solution is definitely
the second patch to fix logical negation, but still it somehow feels ugly to me
to have a limited reimplementation of crossjumping in the sh-treg-combine pass.
Replacing stuff of that pass by improving other optimizations is IMHO beyond
the scope of this bug, though.

[1] These are actually performance reasons:
https://gcc.gnu.org/ml/gcc-patches/2004-07/msg00495.html


  parent reply	other threads:[~2014-11-16 18:54 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-11-08 20:52 [Bug c/63783] New: gcc-4.9: " glaubitz at physik dot fu-berlin.de
2014-11-09  1:12 ` [Bug target/63783] [4.9/5 Regression] [SH] " kkojima at gcc dot gnu.org
2014-11-09  7:14 ` olegendo at gcc dot gnu.org
2014-11-12 23:25 ` gcc-bugzilla at mkarcher dot dialup.fu-berlin.de
2014-11-16  2:36 ` olegendo at gcc dot gnu.org
2014-11-16  7:37 ` gcc-bugzilla at mkarcher dot dialup.fu-berlin.de
2014-11-16  8:24 ` olegendo at gcc dot gnu.org
2014-11-16 10:02 ` gcc-bugzilla at mkarcher dot dialup.fu-berlin.de
2014-11-16 10:41 ` gcc-bugzilla at mkarcher dot dialup.fu-berlin.de
2014-11-16 11:01 ` olegendo at gcc dot gnu.org
2014-11-16 12:24 ` gcc-bugzilla at mkarcher dot dialup.fu-berlin.de
2014-11-16 18:54 ` gcc-bugzilla at mkarcher dot dialup.fu-berlin.de [this message]
2014-11-16 23:44 ` olegendo at gcc dot gnu.org
2014-11-19 13:27 ` rguenth at gcc dot gnu.org
2014-11-21  3:41 ` olegendo at gcc dot gnu.org
2014-11-21 18:53 ` gcc-bugzilla at mkarcher dot dialup.fu-berlin.de
2014-11-22  3:28 ` olegendo at gcc dot gnu.org
2014-11-22  3:33 ` olegendo at gcc dot gnu.org
2014-11-22 10:14 ` gcc-bugzilla at mkarcher dot dialup.fu-berlin.de
2014-11-22 10:39 ` olegendo at gcc dot gnu.org
2014-11-22 11:07 ` gcc-bugzilla at mkarcher dot dialup.fu-berlin.de
2014-11-22 15:34 ` olegendo at gcc dot gnu.org
2014-11-22 15:37 ` gcc-bugzilla at mkarcher dot dialup.fu-berlin.de
2014-11-22 15:50 ` olegendo at gcc dot gnu.org
2014-11-22 16:08 ` olegendo at gcc dot gnu.org
2014-11-24 16:57 ` rguenth 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-63783-4-Ba0FeRBjBd@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).