public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/98026] New: optimization dependant on condition order
@ 2020-11-27 10:04 denis.campredon at gmail dot com
  2020-11-27 10:52 ` [Bug tree-optimization/98026] " rguenth at gcc dot gnu.org
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: denis.campredon at gmail dot com @ 2020-11-27 10:04 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 98026
           Summary: optimization dependant on condition order
           Product: gcc
           Version: 11.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: tree-optimization
          Assignee: unassigned at gcc dot gnu.org
          Reporter: denis.campredon at gmail dot com
  Target Milestone: ---

In all the following functions gcc should recognize that j can't be greater
than 100, and link_error should not appear in assembly. Currently only f3 is
optimized.


-------------------
void link_error();

void f1(int i, int j) {
  if (j > i || i > 100) return;

  if (j > 100) link_error();
}

void f2(int i, int j) {
  if (i > 100 || j > i) return;

  if (j > 100) link_error();
}

void f3(int i, int j) {
  if (i > 100) return;
  if (j > i) return;

  if (j > 100) link_error();
}

void f4(signed int i,unsigned int j) {
  if (i > 100) return;
  if (j > i) return;

  if (j > 100) link_error();
}
------------------

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

end of thread, other threads:[~2022-01-28 23:18 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-27 10:04 [Bug tree-optimization/98026] New: optimization dependant on condition order denis.campredon at gmail dot com
2020-11-27 10:52 ` [Bug tree-optimization/98026] " rguenth at gcc dot gnu.org
2021-07-19  4:17 ` pinskia at gcc dot gnu.org
2022-01-12 19:34 ` amacleod at redhat dot com
2022-01-28 23:15 ` amacleod at redhat dot com
2022-01-28 23:18 ` amacleod at redhat dot com

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