public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/95187] New: Failure to optimize bool check into consecutive literals
@ 2020-05-18 13:16 gabravier at gmail dot com
  2020-05-19  6:24 ` [Bug tree-optimization/95187] " rguenth at gcc dot gnu.org
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: gabravier at gmail dot com @ 2020-05-18 13:16 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 95187
           Summary: Failure to optimize bool check into consecutive
                    literals
           Product: gcc
           Version: 11.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: tree-optimization
          Assignee: unassigned at gcc dot gnu.org
          Reporter: gabravier at gmail dot com
  Target Milestone: ---

int f(bool b)
{
    if (b)
        return 1;
    return 2;
}

This can be optimized into `2 - (int)b`. LLVM does this transformation, but GCC
does not.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug tree-optimization/95187] Failure to optimize bool check into consecutive literals
  2020-05-18 13:16 [Bug tree-optimization/95187] New: Failure to optimize bool check into consecutive literals gabravier at gmail dot com
@ 2020-05-19  6:24 ` rguenth at gcc dot gnu.org
  2020-05-24 22:29 ` pinskia at gcc dot gnu.org
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: rguenth at gcc dot gnu.org @ 2020-05-19  6:24 UTC (permalink / raw)
  To: gcc-bugs

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

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2020-05-19
     Ever confirmed|0                           |1

--- Comment #1 from Richard Biener <rguenth at gcc dot gnu.org> ---
Sth for phiopt.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug tree-optimization/95187] Failure to optimize bool check into consecutive literals
  2020-05-18 13:16 [Bug tree-optimization/95187] New: Failure to optimize bool check into consecutive literals gabravier at gmail dot com
  2020-05-19  6:24 ` [Bug tree-optimization/95187] " rguenth at gcc dot gnu.org
@ 2020-05-24 22:29 ` pinskia at gcc dot gnu.org
  2021-09-02 15:25 ` gabravier at gmail dot com
  2022-10-31  6:25 ` pinskia at gcc dot gnu.org
  3 siblings, 0 replies; 5+ messages in thread
From: pinskia at gcc dot gnu.org @ 2020-05-24 22:29 UTC (permalink / raw)
  To: gcc-bugs

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

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

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

--- Comment #2 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
(In reply to Richard Biener from comment #1)
> Sth for phiopt.

Or expand phiopt to use match and simplify and then it is a job for match.pd.  
I have a patch which does both really.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug tree-optimization/95187] Failure to optimize bool check into consecutive literals
  2020-05-18 13:16 [Bug tree-optimization/95187] New: Failure to optimize bool check into consecutive literals gabravier at gmail dot com
  2020-05-19  6:24 ` [Bug tree-optimization/95187] " rguenth at gcc dot gnu.org
  2020-05-24 22:29 ` pinskia at gcc dot gnu.org
@ 2021-09-02 15:25 ` gabravier at gmail dot com
  2022-10-31  6:25 ` pinskia at gcc dot gnu.org
  3 siblings, 0 replies; 5+ messages in thread
From: gabravier at gmail dot com @ 2021-09-02 15:25 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 from Gabriel Ravier <gabravier at gmail dot com> ---
Seems to be fixed since GCC 11

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug tree-optimization/95187] Failure to optimize bool check into consecutive literals
  2020-05-18 13:16 [Bug tree-optimization/95187] New: Failure to optimize bool check into consecutive literals gabravier at gmail dot com
                   ` (2 preceding siblings ...)
  2021-09-02 15:25 ` gabravier at gmail dot com
@ 2022-10-31  6:25 ` pinskia at gcc dot gnu.org
  3 siblings, 0 replies; 5+ messages in thread
From: pinskia at gcc dot gnu.org @ 2022-10-31  6:25 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
         Resolution|---                         |FIXED
           See Also|                            |https://gcc.gnu.org/bugzill
                   |                            |a/show_bug.cgi?id=88676
   Target Milestone|---                         |11.0

--- Comment #4 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Fixed by r9-5223-g0119d5a23abf2f (PR 88676).

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2022-10-31  6:25 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-18 13:16 [Bug tree-optimization/95187] New: Failure to optimize bool check into consecutive literals gabravier at gmail dot com
2020-05-19  6:24 ` [Bug tree-optimization/95187] " rguenth at gcc dot gnu.org
2020-05-24 22:29 ` pinskia at gcc dot gnu.org
2021-09-02 15:25 ` gabravier at gmail dot com
2022-10-31  6:25 ` pinskia at gcc dot gnu.org

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