public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug rtl-optimization/99305] New: [11 Regression] range condition simplification after inlining
@ 2021-02-27 14:23 nok.raven at gmail dot com
  2021-03-01  9:22 ` [Bug rtl-optimization/99305] " rguenth at gcc dot gnu.org
                   ` (7 more replies)
  0 siblings, 8 replies; 9+ messages in thread
From: nok.raven at gmail dot com @ 2021-02-27 14:23 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 99305
           Summary: [11 Regression] range condition simplification after
                    inlining
           Product: gcc
           Version: 11.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: rtl-optimization
          Assignee: unassigned at gcc dot gnu.org
          Reporter: nok.raven at gmail dot com
  Target Milestone: ---

bool foo(char c)
{
    return c >= '0' && c <= '9';
}

bool bar(char c)
{
    return c != '\0' && foo(c);
}

bool foobar(char c)
{
    return c != '\0' && c >= '0' && c <= '9';
}

// GCC 10
bar(char):
  sub edi, 48
  cmp dil, 9
  setbe al
  ret

// GCC 11
bar(char):
  xor eax, eax
  test dil, dil
  je .L3
  sub edi, 48
  cmp dil, 9
  setbe al
.L3:
  ret

https://godbolt.org/z/z4r9cv

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

end of thread, other threads:[~2021-03-10 16:41 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-02-27 14:23 [Bug rtl-optimization/99305] New: [11 Regression] range condition simplification after inlining nok.raven at gmail dot com
2021-03-01  9:22 ` [Bug rtl-optimization/99305] " rguenth at gcc dot gnu.org
2021-03-09 12:02 ` [Bug tree-optimization/99305] " jakub at gcc dot gnu.org
2021-03-09 12:20 ` jakub at gcc dot gnu.org
2021-03-09 12:20 ` jakub at gcc dot gnu.org
2021-03-09 12:41 ` jakub at gcc dot gnu.org
2021-03-09 18:13 ` cvs-commit at gcc dot gnu.org
2021-03-09 18:14 ` jakub at gcc dot gnu.org
2021-03-10 16:41 ` cvs-commit 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).