public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "jakub at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug target/64338] [5 Regression] ICE in swap_condition, at jump.c:628
Date: Wed, 07 Jan 2015 09:28:00 -0000	[thread overview]
Message-ID: <bug-64338-4-lmpz0ZJxOI@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-64338-4@http.gcc.gnu.org/bugzilla/>

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

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |ASSIGNED
           Assignee|unassigned at gcc dot gnu.org      |jakub at gcc dot gnu.org

--- Comment #3 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Created attachment 34393
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=34393&action=edit
gcc5-pr64338.patch

ix86_expand_int_movcc is called there with (ltgt (reg:CCFPU flags) (const_int
0)) condition, and I see several issues with that:
1) the code assumes that reverse_condition (whatever kind of that) always
succeeds, which is not always true; we shouldn't swap things if we can't
reverse condition
2) for CCFP/CCFPU modes, we should treat them like floating point modes, LTGT
is reversible
3) in the first hunk, there are dead assignments:
compare_code = reverse_condition_maybe_unordered (compare_code);
and
compare_code = reverse_condition (compare_code);
when only a few lines below that there is unconditional:
compare_code = UNKNOWN;
4) (not handled in the patch), diff uses HOST_WIDE_INT variable, signed, and
the
values can be arbitrary, so we can end up with undefined behavior in the
compiler if cf - ct overflows, or if diff is HWI minimum on diff = -diff etc.


  parent reply	other threads:[~2015-01-07  9:28 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-12-17 10:30 [Bug target/64338] New: " rguenth at gcc dot gnu.org
2014-12-17 10:31 ` [Bug target/64338] " rguenth at gcc dot gnu.org
2014-12-17 13:45 ` trippels at gcc dot gnu.org
2014-12-17 15:07 ` mpolacek at gcc dot gnu.org
2015-01-07  9:28 ` jakub at gcc dot gnu.org [this message]
2015-01-08 19:16 ` jakub at gcc dot gnu.org
2015-01-08 19:30 ` 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-64338-4-lmpz0ZJxOI@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).