public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/101615] New: wrong code at -O3 on x86_64-linux-gnu
@ 2021-07-24 20:53 qrzhang at gatech dot edu
  2021-07-24 20:53 ` [Bug tree-optimization/101615] " qrzhang at gatech dot edu
                   ` (7 more replies)
  0 siblings, 8 replies; 9+ messages in thread
From: qrzhang at gatech dot edu @ 2021-07-24 20:53 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 101615
           Summary: wrong code at -O3 on x86_64-linux-gnu
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: tree-optimization
          Assignee: unassigned at gcc dot gnu.org
          Reporter: qrzhang at gatech dot edu
  Target Milestone: ---

It appears to be a recent regression.

$ gcc-trunk -v
Supported LTO compression algorithms: zlib
gcc version 12.0.0 20210724 (experimental) [master revision
e314cfc371d:5eb84b79079:ead235f60139edc6eb408d8d083cbb15e417b447] (GCC)

$ gcc-trunk abc.c ; ./a.out
5
7
11
3
3
3



$ gcc-trunk -O3 abc.c ; ./a.out
5
7
3
3
3
11

$ cat abc.c
int a[50] = {5, 5, 8};
short b;
int c, d;
int main() {
  int e;
  for (; b <= 4; b++)
    for (; c <= 4; c++) {
      *a |= 1;
      e = 0;
      for (; e <= 4; e++)
        a[e + 1] |= 3;
    }
  for (; d < 6; d++)
    printf("%d\n", a[d]);
}

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

* [Bug tree-optimization/101615] wrong code at -O3 on x86_64-linux-gnu
  2021-07-24 20:53 [Bug tree-optimization/101615] New: wrong code at -O3 on x86_64-linux-gnu qrzhang at gatech dot edu
@ 2021-07-24 20:53 ` qrzhang at gatech dot edu
  2021-07-24 20:59 ` [Bug tree-optimization/101615] [12 Regression] wrong code at -O3 on x86_64-linux-gnu since r12-1872 pinskia at gcc dot gnu.org
                   ` (6 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: qrzhang at gatech dot edu @ 2021-07-24 20:53 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #1 from Qirun Zhang <qrzhang at gatech dot edu> ---
My bisection points to g:6df6055d5c666e669890ff8

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

* [Bug tree-optimization/101615] [12 Regression] wrong code at -O3 on x86_64-linux-gnu since r12-1872
  2021-07-24 20:53 [Bug tree-optimization/101615] New: wrong code at -O3 on x86_64-linux-gnu qrzhang at gatech dot edu
  2021-07-24 20:53 ` [Bug tree-optimization/101615] " qrzhang at gatech dot edu
@ 2021-07-24 20:59 ` pinskia at gcc dot gnu.org
  2021-07-27 10:48 ` rguenth at gcc dot gnu.org
                   ` (5 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: pinskia at gcc dot gnu.org @ 2021-07-24 20:59 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Target|                            |x86_64-linux-gnu
   Target Milestone|---                         |12.0
            Summary|wrong code at -O3 on        |[12 Regression] wrong code
                   |x86_64-linux-gnu since      |at -O3 on x86_64-linux-gnu
                   |r12-1872                    |since r12-1872
           Keywords|                            |wrong-code

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

* [Bug tree-optimization/101615] [12 Regression] wrong code at -O3 on x86_64-linux-gnu since r12-1872
  2021-07-24 20:53 [Bug tree-optimization/101615] New: wrong code at -O3 on x86_64-linux-gnu qrzhang at gatech dot edu
  2021-07-24 20:53 ` [Bug tree-optimization/101615] " qrzhang at gatech dot edu
  2021-07-24 20:59 ` [Bug tree-optimization/101615] [12 Regression] wrong code at -O3 on x86_64-linux-gnu since r12-1872 pinskia at gcc dot gnu.org
@ 2021-07-27 10:48 ` rguenth at gcc dot gnu.org
  2021-07-28 13:14 ` cvs-commit at gcc dot gnu.org
                   ` (4 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: rguenth at gcc dot gnu.org @ 2021-07-27 10:48 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Version|unknown                     |12.0
           Assignee|unassigned at gcc dot gnu.org      |rguenth at gcc dot gnu.org
             Status|UNCONFIRMED                 |ASSIGNED
     Ever confirmed|0                           |1
   Last reconfirmed|                            |2021-07-27

--- Comment #2 from Richard Biener <rguenth at gcc dot gnu.org> ---
I will have a look.

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

* [Bug tree-optimization/101615] [12 Regression] wrong code at -O3 on x86_64-linux-gnu since r12-1872
  2021-07-24 20:53 [Bug tree-optimization/101615] New: wrong code at -O3 on x86_64-linux-gnu qrzhang at gatech dot edu
                   ` (2 preceding siblings ...)
  2021-07-27 10:48 ` rguenth at gcc dot gnu.org
@ 2021-07-28 13:14 ` cvs-commit at gcc dot gnu.org
  2021-07-28 13:15 ` rguenth at gcc dot gnu.org
                   ` (3 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2021-07-28 13:14 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Richard Biener <rguenth@gcc.gnu.org>:

https://gcc.gnu.org/g:6bb6e2044ced33d08175361b8e39a9c5d4a868a6

commit r12-2570-g6bb6e2044ced33d08175361b8e39a9c5d4a868a6
Author: Richard Biener <rguenther@suse.de>
Date:   Wed Jul 28 14:16:35 2021 +0200

    tree-optimization/101615 - SLP permute opt of existing vectors

    This fixes one issue discovered when analyzing PR101615, namely
    we happily push permutes to pre-existing vectors but end up
    not actually permuting them.  In fact we don't want to, so force
    materialization on the external.

    It doesn't fix the original testcase though.

    2021-07-28  Richard Biener  <rguenther@suse.de>

            PR tree-optimization/101615
            * tree-vect-slp.c (vect_optimize_slp): Pre-existing vector
            external nodes cannot be permuted so make them perm_out 0.

            * gcc.dg/vect/bb-slp-pr101615-1.c: New testcase.

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

* [Bug tree-optimization/101615] [12 Regression] wrong code at -O3 on x86_64-linux-gnu since r12-1872
  2021-07-24 20:53 [Bug tree-optimization/101615] New: wrong code at -O3 on x86_64-linux-gnu qrzhang at gatech dot edu
                   ` (3 preceding siblings ...)
  2021-07-28 13:14 ` cvs-commit at gcc dot gnu.org
@ 2021-07-28 13:15 ` rguenth at gcc dot gnu.org
  2021-07-28 15:41 ` cvs-commit at gcc dot gnu.org
                   ` (2 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: rguenth at gcc dot gnu.org @ 2021-07-28 13:15 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #4 from Richard Biener <rguenth at gcc dot gnu.org> ---
I'm now testing the other half of the fix.

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

* [Bug tree-optimization/101615] [12 Regression] wrong code at -O3 on x86_64-linux-gnu since r12-1872
  2021-07-24 20:53 [Bug tree-optimization/101615] New: wrong code at -O3 on x86_64-linux-gnu qrzhang at gatech dot edu
                   ` (4 preceding siblings ...)
  2021-07-28 13:15 ` rguenth at gcc dot gnu.org
@ 2021-07-28 15:41 ` cvs-commit at gcc dot gnu.org
  2021-07-28 15:41 ` rguenth at gcc dot gnu.org
  2022-01-13 10:54 ` cvs-commit at gcc dot gnu.org
  7 siblings, 0 replies; 9+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2021-07-28 15:41 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #5 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Richard Biener <rguenth@gcc.gnu.org>:

https://gcc.gnu.org/g:3c91efec15af4f922a9af495e178bbb66d2e9d1f

commit r12-2573-g3c91efec15af4f922a9af495e178bbb66d2e9d1f
Author: Richard Biener <rguenther@suse.de>
Date:   Wed Jul 28 15:12:00 2021 +0200

    tree-optimization/101615 - SLP permute opt with CTOR roots

    CTOR roots are not explicitely represented so we have to make sure
    to materialize permutes on SLP graph entries to them.

    2021-07-28  Richard Biener  <rguenther@suse.de>

            PR tree-optimization/101615
            * tree-vect-slp.c (vect_optimize_slp): Materialize permutes
            at CTOR SLP graph entries.

            * gcc.dg/vect/bb-slp-pr101615-2.c: New testcase.

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

* [Bug tree-optimization/101615] [12 Regression] wrong code at -O3 on x86_64-linux-gnu since r12-1872
  2021-07-24 20:53 [Bug tree-optimization/101615] New: wrong code at -O3 on x86_64-linux-gnu qrzhang at gatech dot edu
                   ` (5 preceding siblings ...)
  2021-07-28 15:41 ` cvs-commit at gcc dot gnu.org
@ 2021-07-28 15:41 ` rguenth at gcc dot gnu.org
  2022-01-13 10:54 ` cvs-commit at gcc dot gnu.org
  7 siblings, 0 replies; 9+ messages in thread
From: rguenth at gcc dot gnu.org @ 2021-07-28 15:41 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
         Resolution|---                         |FIXED

--- Comment #6 from Richard Biener <rguenth at gcc dot gnu.org> ---
Fixed.

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

* [Bug tree-optimization/101615] [12 Regression] wrong code at -O3 on x86_64-linux-gnu since r12-1872
  2021-07-24 20:53 [Bug tree-optimization/101615] New: wrong code at -O3 on x86_64-linux-gnu qrzhang at gatech dot edu
                   ` (6 preceding siblings ...)
  2021-07-28 15:41 ` rguenth at gcc dot gnu.org
@ 2022-01-13 10:54 ` cvs-commit at gcc dot gnu.org
  7 siblings, 0 replies; 9+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2022-01-13 10:54 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #7 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-11 branch has been updated by Richard Biener
<rguenth@gcc.gnu.org>:

https://gcc.gnu.org/g:7f49f50f756c06f4093358ff77c11152777fff1c

commit r11-9458-g7f49f50f756c06f4093358ff77c11152777fff1c
Author: Richard Biener <rguenther@suse.de>
Date:   Wed Jul 28 15:12:00 2021 +0200

    tree-optimization/101615 - SLP permute opt with CTOR roots

    CTOR roots are not explicitely represented so we have to make sure
    to materialize permutes on SLP graph entries to them.

    2021-07-28  Richard Biener  <rguenther@suse.de>

            PR tree-optimization/101615
            PR tree-optimization/103995
            * tree-vect-slp.c (vect_optimize_slp): Materialize permutes
            at CTOR SLP graph entries.

            * gcc.dg/vect/bb-slp-pr101615-2.c: New testcase.

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

end of thread, other threads:[~2022-01-13 10:54 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-07-24 20:53 [Bug tree-optimization/101615] New: wrong code at -O3 on x86_64-linux-gnu qrzhang at gatech dot edu
2021-07-24 20:53 ` [Bug tree-optimization/101615] " qrzhang at gatech dot edu
2021-07-24 20:59 ` [Bug tree-optimization/101615] [12 Regression] wrong code at -O3 on x86_64-linux-gnu since r12-1872 pinskia at gcc dot gnu.org
2021-07-27 10:48 ` rguenth at gcc dot gnu.org
2021-07-28 13:14 ` cvs-commit at gcc dot gnu.org
2021-07-28 13:15 ` rguenth at gcc dot gnu.org
2021-07-28 15:41 ` cvs-commit at gcc dot gnu.org
2021-07-28 15:41 ` rguenth at gcc dot gnu.org
2022-01-13 10:54 ` 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).