public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug middle-end/115101] New: [wrong code] with -O1 -floop-nest-optimize for gcc.dg/graphite/interchange-8.c
@ 2024-05-15  8:20 liuhongt at gcc dot gnu.org
  2024-05-15 10:10 ` [Bug tree-optimization/115101] " rguenth at gcc dot gnu.org
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: liuhongt at gcc dot gnu.org @ 2024-05-15  8:20 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 115101
           Summary: [wrong code] with -O1 -floop-nest-optimize for
                    gcc.dg/graphite/interchange-8.c
           Product: gcc
           Version: 15.0
            Status: UNCONFIRMED
          Keywords: wrong-code
          Severity: normal
          Priority: P3
         Component: middle-end
          Assignee: unassigned at gcc dot gnu.org
          Reporter: liuhongt at gcc dot gnu.org
  Target Milestone: ---

When I'm working on turning cunrolli, I found if cunrollis is disabled, the
testcase will fail.
It can be reproduced with trunk for -O1 -floop-nest-optimize.

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

* [Bug tree-optimization/115101] [wrong code] with -O1 -floop-nest-optimize for gcc.dg/graphite/interchange-8.c
  2024-05-15  8:20 [Bug middle-end/115101] New: [wrong code] with -O1 -floop-nest-optimize for gcc.dg/graphite/interchange-8.c liuhongt at gcc dot gnu.org
@ 2024-05-15 10:10 ` rguenth at gcc dot gnu.org
  2024-05-16  2:04 ` [Bug tree-optimization/115101] [11/12/13/14/15 regression] " sjames at gcc dot gnu.org
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: rguenth at gcc dot gnu.org @ 2024-05-15 10:10 UTC (permalink / raw)
  To: gcc-bugs

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

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |rguenth at gcc dot gnu.org
   Last reconfirmed|                            |2024-05-15
             Status|UNCONFIRMED                 |NEW
          Component|middle-end                  |tree-optimization
     Ever confirmed|0                           |1

--- Comment #1 from Richard Biener <rguenth at gcc dot gnu.org> ---
Confirmed.

[scheduler] original ast:
for (int c0 = 0; c0 <= 3; c0 += 1)
  for (int c1 = 0; c1 <= 3; c1 += 1) {
    for (int c2 = 0; c2 <= 3; c2 += 1) {
      for (int c3 = 0; c3 <= 1; c3 += 1)
        S_3(c0, c1, c2, c3);
      S_21(c0, c1, c2);
    }
    for (int c2 = 0; c2 <= 1; c2 += 1)
      for (int c5 = 0; c5 <= 3; c5 += 1)
        S_6(c0, c1, c5, c2);
    for (int c2 = 0; c2 <= 3; c2 += 1)
      S_23(c0, c1, c2);
  }

shows something goes wrong translating the sibling loop or the original AST
shown is in fact a transformed one already.  The transformed shown shows
an extra interchange:

[scheduler] AST generated by isl:
for (int c0 = 0; c0 <= 3; c0 += 1)
  for (int c1 = 0; c1 <= 3; c1 += 1) {
    for (int c2 = 0; c2 <= 3; c2 += 1) {
      for (int c3 = 0; c3 <= 1; c3 += 1)
        S_3(c0, c1, c2, c3);
      S_21(c0, c1, c2);
    }
    for (int c4 = 0; c4 <= 3; c4 += 1)
      for (int c5 = 0; c5 <= 1; c5 += 1)
        S_6(c0, c1, c4, c5);
    for (int c2 = 0; c2 <= 3; c2 += 1)
      S_23(c0, c1, c2);
  }

but the distribution of the sibling for (i...) loop looks confused already.

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

* [Bug tree-optimization/115101] [11/12/13/14/15 regression] [wrong code] with -O1 -floop-nest-optimize for gcc.dg/graphite/interchange-8.c
  2024-05-15  8:20 [Bug middle-end/115101] New: [wrong code] with -O1 -floop-nest-optimize for gcc.dg/graphite/interchange-8.c liuhongt at gcc dot gnu.org
  2024-05-15 10:10 ` [Bug tree-optimization/115101] " rguenth at gcc dot gnu.org
@ 2024-05-16  2:04 ` sjames at gcc dot gnu.org
  2024-05-16  6:23 ` rguenth at gcc dot gnu.org
  2024-07-19 13:25 ` [Bug tree-optimization/115101] [12/13/14/15 " rguenth at gcc dot gnu.org
  3 siblings, 0 replies; 5+ messages in thread
From: sjames at gcc dot gnu.org @ 2024-05-16  2:04 UTC (permalink / raw)
  To: gcc-bugs

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

Sam James <sjames at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|[wrong code] with -O1       |[11/12/13/14/15 regression]
                   |-floop-nest-optimize for    |[wrong code] with -O1
                   |gcc.dg/graphite/interchange |-floop-nest-optimize for
                   |-8.c                        |gcc.dg/graphite/interchange
                   |                            |-8.c
      Known to work|                            |5.4.0
      Known to fail|                            |6.1.0
                 CC|                            |sjames at gcc dot gnu.org

--- Comment #2 from Sam James <sjames at gcc dot gnu.org> ---
on godbolt, it looks like gcc-5.4 is fine, and 6.1 isn't

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

* [Bug tree-optimization/115101] [11/12/13/14/15 regression] [wrong code] with -O1 -floop-nest-optimize for gcc.dg/graphite/interchange-8.c
  2024-05-15  8:20 [Bug middle-end/115101] New: [wrong code] with -O1 -floop-nest-optimize for gcc.dg/graphite/interchange-8.c liuhongt at gcc dot gnu.org
  2024-05-15 10:10 ` [Bug tree-optimization/115101] " rguenth at gcc dot gnu.org
  2024-05-16  2:04 ` [Bug tree-optimization/115101] [11/12/13/14/15 regression] " sjames at gcc dot gnu.org
@ 2024-05-16  6:23 ` rguenth at gcc dot gnu.org
  2024-07-19 13:25 ` [Bug tree-optimization/115101] [12/13/14/15 " rguenth at gcc dot gnu.org
  3 siblings, 0 replies; 5+ messages in thread
From: rguenth at gcc dot gnu.org @ 2024-05-16  6:23 UTC (permalink / raw)
  To: gcc-bugs

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

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |11.5

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

* [Bug tree-optimization/115101] [12/13/14/15 regression] [wrong code] with -O1 -floop-nest-optimize for gcc.dg/graphite/interchange-8.c
  2024-05-15  8:20 [Bug middle-end/115101] New: [wrong code] with -O1 -floop-nest-optimize for gcc.dg/graphite/interchange-8.c liuhongt at gcc dot gnu.org
                   ` (2 preceding siblings ...)
  2024-05-16  6:23 ` rguenth at gcc dot gnu.org
@ 2024-07-19 13:25 ` rguenth at gcc dot gnu.org
  3 siblings, 0 replies; 5+ messages in thread
From: rguenth at gcc dot gnu.org @ 2024-07-19 13:25 UTC (permalink / raw)
  To: gcc-bugs

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

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|11.5                        |12.5

--- Comment #3 from Richard Biener <rguenth at gcc dot gnu.org> ---
GCC 11 branch is being closed.

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

end of thread, other threads:[~2024-07-19 13:25 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-05-15  8:20 [Bug middle-end/115101] New: [wrong code] with -O1 -floop-nest-optimize for gcc.dg/graphite/interchange-8.c liuhongt at gcc dot gnu.org
2024-05-15 10:10 ` [Bug tree-optimization/115101] " rguenth at gcc dot gnu.org
2024-05-16  2:04 ` [Bug tree-optimization/115101] [11/12/13/14/15 regression] " sjames at gcc dot gnu.org
2024-05-16  6:23 ` rguenth at gcc dot gnu.org
2024-07-19 13:25 ` [Bug tree-optimization/115101] [12/13/14/15 " rguenth 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).