public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "pinskia at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug tree-optimization/111668] vrp2 (match and simplify) introduces invalid wide signed Boolean values
Date: Mon, 02 Oct 2023 22:28:39 +0000	[thread overview]
Message-ID: <bug-111668-4-ySAIVpr2su@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-111668-4@http.gcc.gnu.org/bugzilla/>

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

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|vrp2 introduces invalid     |vrp2 (match and simplify)
                   |wide Boolean values         |introduces invalid wide
                   |                            |signed Boolean values
   Last reconfirmed|                            |2023-10-02
             Status|UNCONFIRMED                 |NEW
                 CC|                            |jakub at gcc dot gnu.org
     Ever confirmed|0                           |1
           Keywords|                            |wrong-code

--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
This was broken by r14-4125-g5c5851bd93b8 .


Before VRP:
```
  # RANGE [irange] <signed-boolean:32> [-1, 0]
  _66 = _16 ? -1 : 0;
  vect_cst__67 = {_66, _66, _66, _66};
```

VRP2 dump:
```
Folding statement: _66 = _16 ? -1 : 0;
Applying pattern match.pd:5115, gimple-match-2.cc:16882
gimple_simplified to _38 = (<signed-boolean:32>) _16;
_66 = -_38;
```

This is was the reasoning for the build_nonstandard_integer_type there. 


With r14-4125-g5c5851bd93b8 reverted:
```
Folding statement: _66 = _16 ? -1 : 0;
Applying pattern match.pd:5118, gimple-match-1.cc:16933
gimple_simplified to _38 = (signed int) _16;
_43 = -_38;
_66 = (<signed-boolean:32>) _43;
Global Exported: _66 = [irange] <signed-boolean:32> [-1, 0]
Folded into: _66 = (<signed-boolean:32>) _43;
```


Note the testcase needs to compiled at -O3 on x86_64.

  reply	other threads:[~2023-10-02 22:28 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-02 22:14 [Bug tree-optimization/111668] New: vrp2 introduces invalid wide " kristerw at gcc dot gnu.org
2023-10-02 22:28 ` pinskia at gcc dot gnu.org [this message]
2023-10-02 22:30 ` [Bug tree-optimization/111668] vrp2 (match and simplify) introduces invalid wide signed " pinskia at gcc dot gnu.org
2023-10-02 22:32 ` [Bug tree-optimization/111668] [12/13/14 Regression] " pinskia at gcc dot gnu.org
2023-10-03  8:33 ` jakub at gcc dot gnu.org
2023-10-03  8:48 ` jakub at gcc dot gnu.org
2023-10-04  7:29 ` cvs-commit at gcc dot gnu.org
2023-10-04  7:33 ` [Bug tree-optimization/111668] [12/13 " jakub at gcc dot gnu.org
2023-10-04  9:45 ` rguenth at gcc dot gnu.org
2023-10-08 21:41 ` kristerw at gcc dot gnu.org
2023-11-27 23:22 ` kristerw at gcc dot gnu.org
2024-05-13 11:30 ` 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-111668-4-ySAIVpr2su@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).