public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/107880] New: bool tautology missed optimisation
@ 2022-11-26 18:03 pinskia at gcc dot gnu.org
  2022-11-26 18:06 ` [Bug tree-optimization/107880] " pinskia at gcc dot gnu.org
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: pinskia at gcc dot gnu.org @ 2022-11-26 18:03 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 107880
           Summary: bool tautology missed optimisation
           Product: gcc
           Version: 13.0
            Status: UNCONFIRMED
          Keywords: missed-optimization
          Severity: enhancement
          Priority: P3
         Component: tree-optimization
          Assignee: unassigned at gcc dot gnu.org
          Reporter: pinskia at gcc dot gnu.org
  Target Milestone: ---

From bug 91882 comment #1 (since the testcase in that was in bug 91882 comment
#0 is now fixed):

bool impl(bool a, bool b)
{
    return (!a || b);
}

// bad optimisation
bool always_true(bool a, bool b)
{
    return (impl(a,b) == impl(b,a)) == (a == b);
           // ( (a -> b) = (b -> a) ) = (a = b) tautology
}

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

end of thread, other threads:[~2023-09-12 15:03 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-11-26 18:03 [Bug tree-optimization/107880] New: bool tautology missed optimisation pinskia at gcc dot gnu.org
2022-11-26 18:06 ` [Bug tree-optimization/107880] " pinskia at gcc dot gnu.org
2022-11-26 18:11 ` pinskia at gcc dot gnu.org
2023-05-24  1:15 ` pinskia at gcc dot gnu.org
2023-08-28 20:36 ` pinskia at gcc dot gnu.org
2023-08-28 21:30 ` pinskia at gcc dot gnu.org
2023-08-28 22:52 ` pinskia at gcc dot gnu.org
2023-09-12 15:03 ` 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).