public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/102673] New: [9 Regression] Wrong code with -O due to adjust_cond_for_loop_until_wrap
@ 2021-10-09 21:38 ibuclaw at gcc dot gnu.org
  2021-10-09 21:43 ` [Bug tree-optimization/102673] " ibuclaw at gcc dot gnu.org
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: ibuclaw at gcc dot gnu.org @ 2021-10-09 21:38 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 102673
           Summary: [9 Regression] Wrong code with -O due to
                    adjust_cond_for_loop_until_wrap
           Product: gcc
           Version: 9.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: tree-optimization
          Assignee: unassigned at gcc dot gnu.org
          Reporter: ibuclaw at gcc dot gnu.org
  Target Milestone: ---

Reduced test, when compiled with -O, optimizes the loop into `return 1;`.
---
int main()
{
    for (unsigned a = 0, b = 0; a < 6; a += 1, b += 2)
    {
         if (b < a)
             return 1;
    }
    return 0;
}
---
https://godbolt.org/z/YM7aYrY8v

Bisected, and the commit that changed behaviour was the fix for pr84648.

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

* [Bug tree-optimization/102673] [9 Regression] Wrong code with -O due to adjust_cond_for_loop_until_wrap
  2021-10-09 21:38 [Bug tree-optimization/102673] New: [9 Regression] Wrong code with -O due to adjust_cond_for_loop_until_wrap ibuclaw at gcc dot gnu.org
@ 2021-10-09 21:43 ` ibuclaw at gcc dot gnu.org
  2021-10-09 21:45 ` ibuclaw at gcc dot gnu.org
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: ibuclaw at gcc dot gnu.org @ 2021-10-09 21:43 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #1 from ibuclaw at gcc dot gnu.org ---
Since pr101145, the function this now happens in is
number_of_iterations_until_wrap.

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

* [Bug tree-optimization/102673] [9 Regression] Wrong code with -O due to adjust_cond_for_loop_until_wrap
  2021-10-09 21:38 [Bug tree-optimization/102673] New: [9 Regression] Wrong code with -O due to adjust_cond_for_loop_until_wrap ibuclaw at gcc dot gnu.org
  2021-10-09 21:43 ` [Bug tree-optimization/102673] " ibuclaw at gcc dot gnu.org
@ 2021-10-09 21:45 ` ibuclaw at gcc dot gnu.org
  2021-10-09 21:58 ` pinskia at gcc dot gnu.org
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: ibuclaw at gcc dot gnu.org @ 2021-10-09 21:45 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #2 from ibuclaw at gcc dot gnu.org ---
(In reply to ibuclaw from comment #0)
> Bisected, and the commit that changed behaviour was the fix for pr84648.
Commit was r9-4145.

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

* [Bug tree-optimization/102673] [9 Regression] Wrong code with -O due to adjust_cond_for_loop_until_wrap
  2021-10-09 21:38 [Bug tree-optimization/102673] New: [9 Regression] Wrong code with -O due to adjust_cond_for_loop_until_wrap ibuclaw at gcc dot gnu.org
  2021-10-09 21:43 ` [Bug tree-optimization/102673] " ibuclaw at gcc dot gnu.org
  2021-10-09 21:45 ` ibuclaw at gcc dot gnu.org
@ 2021-10-09 21:58 ` pinskia at gcc dot gnu.org
  2021-10-09 22:01 ` ibuclaw at gcc dot gnu.org
  2021-10-09 22:06 ` pinskia at gcc dot gnu.org
  4 siblings, 0 replies; 6+ messages in thread
From: pinskia at gcc dot gnu.org @ 2021-10-09 21:58 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|---                         |DUPLICATE

--- Comment #3 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
exact dup of bug 102666 :).

*** This bug has been marked as a duplicate of bug 102666 ***

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

* [Bug tree-optimization/102673] [9 Regression] Wrong code with -O due to adjust_cond_for_loop_until_wrap
  2021-10-09 21:38 [Bug tree-optimization/102673] New: [9 Regression] Wrong code with -O due to adjust_cond_for_loop_until_wrap ibuclaw at gcc dot gnu.org
                   ` (2 preceding siblings ...)
  2021-10-09 21:58 ` pinskia at gcc dot gnu.org
@ 2021-10-09 22:01 ` ibuclaw at gcc dot gnu.org
  2021-10-09 22:06 ` pinskia at gcc dot gnu.org
  4 siblings, 0 replies; 6+ messages in thread
From: ibuclaw at gcc dot gnu.org @ 2021-10-09 22:01 UTC (permalink / raw)
  To: gcc-bugs

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

ibuclaw at gcc dot gnu.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|DUPLICATE                   |FIXED

--- Comment #4 from ibuclaw at gcc dot gnu.org ---
(In reply to Andrew Pinski from comment #3)
> exact dup of bug 102666 :).
> 
> *** This bug has been marked as a duplicate of bug 102666 ***
Excellent, I just saw it hit my queue for the D front-end, with no context of
where they got it from. :-)

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

* [Bug tree-optimization/102673] [9 Regression] Wrong code with -O due to adjust_cond_for_loop_until_wrap
  2021-10-09 21:38 [Bug tree-optimization/102673] New: [9 Regression] Wrong code with -O due to adjust_cond_for_loop_until_wrap ibuclaw at gcc dot gnu.org
                   ` (3 preceding siblings ...)
  2021-10-09 22:01 ` ibuclaw at gcc dot gnu.org
@ 2021-10-09 22:06 ` pinskia at gcc dot gnu.org
  4 siblings, 0 replies; 6+ messages in thread
From: pinskia at gcc dot gnu.org @ 2021-10-09 22:06 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|FIXED                       |DUPLICATE

--- Comment #5 from Andrew Pinski <pinskia at gcc dot gnu.org> ---


*** This bug has been marked as a duplicate of bug 102666 ***

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

end of thread, other threads:[~2021-10-09 22:06 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-10-09 21:38 [Bug tree-optimization/102673] New: [9 Regression] Wrong code with -O due to adjust_cond_for_loop_until_wrap ibuclaw at gcc dot gnu.org
2021-10-09 21:43 ` [Bug tree-optimization/102673] " ibuclaw at gcc dot gnu.org
2021-10-09 21:45 ` ibuclaw at gcc dot gnu.org
2021-10-09 21:58 ` pinskia at gcc dot gnu.org
2021-10-09 22:01 ` ibuclaw at gcc dot gnu.org
2021-10-09 22:06 ` 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).