public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/110965] New: missing combining if ranges due to cast differences
@ 2023-08-10  6:17 pinskia at gcc dot gnu.org
  2023-08-10  6:18 ` [Bug tree-optimization/110965] " pinskia at gcc dot gnu.org
  2023-08-10  7:02 ` pinskia at gcc dot gnu.org
  0 siblings, 2 replies; 3+ messages in thread
From: pinskia at gcc dot gnu.org @ 2023-08-10  6:17 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 110965
           Summary: missing combining if ranges due to cast differences
           Product: gcc
           Version: 14.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: ---

Take:
```
int f(long long l)
{
  int t =  (int)l;
  if (t == 1 || t == 2)
    return true;
  if (t == 3)
    return true;

  return false;
}

int f1(long long l)
{
  unsigned t =  (unsigned)l;
  if (t == 1 || t == 2)
    return true;
  if (t == 3)
    return true;
  return false;
}
```

f and f1 should produce the same code but currently does not.

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

* [Bug tree-optimization/110965] missing combining if ranges due to cast differences
  2023-08-10  6:17 [Bug tree-optimization/110965] New: missing combining if ranges due to cast differences pinskia at gcc dot gnu.org
@ 2023-08-10  6:18 ` pinskia at gcc dot gnu.org
  2023-08-10  7:02 ` pinskia at gcc dot gnu.org
  1 sibling, 0 replies; 3+ messages in thread
From: pinskia at gcc dot gnu.org @ 2023-08-10  6:18 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Note I found this while working on PR 83247 because of the Ada failures.

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

* [Bug tree-optimization/110965] missing combining if ranges due to cast differences
  2023-08-10  6:17 [Bug tree-optimization/110965] New: missing combining if ranges due to cast differences pinskia at gcc dot gnu.org
  2023-08-10  6:18 ` [Bug tree-optimization/110965] " pinskia at gcc dot gnu.org
@ 2023-08-10  7:02 ` pinskia at gcc dot gnu.org
  1 sibling, 0 replies; 3+ messages in thread
From: pinskia at gcc dot gnu.org @ 2023-08-10  7:02 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #2 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Blah, here is a testcase which shows this is causing a regression in GCC 14
(after r14-1597-g64d90d06d2db43):
```
bool f(long long l){
  int t =  (int)l;
  if (t == 1)
   return true;
  if (t == 2)
   return true;
  if (t == 3)
    return true;

  return false;
}
```

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

end of thread, other threads:[~2023-08-10  7:02 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-08-10  6:17 [Bug tree-optimization/110965] New: missing combining if ranges due to cast differences pinskia at gcc dot gnu.org
2023-08-10  6:18 ` [Bug tree-optimization/110965] " pinskia at gcc dot gnu.org
2023-08-10  7:02 ` 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).