* [Bug tree-optimization/113896] [12 Regression] Assigning array elements in the wrong order after floating point optimization
2024-02-13 0:00 [Bug c++/113896] New: Assigning array elements in the wrong order after floating point optimization noobie-iv at mail dot ru
@ 2024-02-13 0:05 ` pinskia at gcc dot gnu.org
2024-02-13 0:16 ` [Bug tree-optimization/113896] [12 Regression] Assigning array elements in the wrong order after floating point optimization since r12-8841 pinskia at gcc dot gnu.org
` (8 subsequent siblings)
9 siblings, 0 replies; 11+ messages in thread
From: pinskia at gcc dot gnu.org @ 2024-02-13 0:05 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113896
Andrew Pinski <pinskia at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Target Milestone|--- |12.4
Summary|Assigning array elements in |[12 Regression] Assigning
|the wrong order after |array elements in the wrong
|floating point optimization |order after floating point
| |optimization
Keywords| |wrong-code
Component|c++ |tree-optimization
Known to fail| |12.3.0
Known to work| |11.4.0, 12.1.0, 12.2.0
^ permalink raw reply [flat|nested] 11+ messages in thread
* [Bug tree-optimization/113896] [12 Regression] Assigning array elements in the wrong order after floating point optimization since r12-8841
2024-02-13 0:00 [Bug c++/113896] New: Assigning array elements in the wrong order after floating point optimization noobie-iv at mail dot ru
2024-02-13 0:05 ` [Bug tree-optimization/113896] [12 Regression] " pinskia at gcc dot gnu.org
@ 2024-02-13 0:16 ` pinskia at gcc dot gnu.org
2024-02-13 8:42 ` rguenth at gcc dot gnu.org
` (7 subsequent siblings)
9 siblings, 0 replies; 11+ messages in thread
From: pinskia at gcc dot gnu.org @ 2024-02-13 0:16 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113896
Andrew Pinski <pinskia at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Summary|[12 Regression] Assigning |[12 Regression] Assigning
|array elements in the wrong |array elements in the wrong
|order after floating point |order after floating point
|optimization |optimization since r12-8841
--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
r12-8841-gfe7d74313736b8
^ permalink raw reply [flat|nested] 11+ messages in thread
* [Bug tree-optimization/113896] [12 Regression] Assigning array elements in the wrong order after floating point optimization since r12-8841
2024-02-13 0:00 [Bug c++/113896] New: Assigning array elements in the wrong order after floating point optimization noobie-iv at mail dot ru
2024-02-13 0:05 ` [Bug tree-optimization/113896] [12 Regression] " pinskia at gcc dot gnu.org
2024-02-13 0:16 ` [Bug tree-optimization/113896] [12 Regression] Assigning array elements in the wrong order after floating point optimization since r12-8841 pinskia at gcc dot gnu.org
@ 2024-02-13 8:42 ` rguenth at gcc dot gnu.org
2024-02-13 8:43 ` rguenth at gcc dot gnu.org
` (6 subsequent siblings)
9 siblings, 0 replies; 11+ messages in thread
From: rguenth at gcc dot gnu.org @ 2024-02-13 8:42 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113896
Richard Biener <rguenth at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |rguenth at gcc dot gnu.org
Keywords| |needs-bisection
--- Comment #2 from Richard Biener <rguenth at gcc dot gnu.org> ---
what fixed it?
^ permalink raw reply [flat|nested] 11+ messages in thread
* [Bug tree-optimization/113896] [12 Regression] Assigning array elements in the wrong order after floating point optimization since r12-8841
2024-02-13 0:00 [Bug c++/113896] New: Assigning array elements in the wrong order after floating point optimization noobie-iv at mail dot ru
` (2 preceding siblings ...)
2024-02-13 8:42 ` rguenth at gcc dot gnu.org
@ 2024-02-13 8:43 ` rguenth at gcc dot gnu.org
2024-02-13 12:36 ` rguenth at gcc dot gnu.org
` (5 subsequent siblings)
9 siblings, 0 replies; 11+ messages in thread
From: rguenth at gcc dot gnu.org @ 2024-02-13 8:43 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113896
Richard Biener <rguenth at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Last reconfirmed| |2024-02-13
Keywords|needs-bisection |
Assignee|unassigned at gcc dot gnu.org |rguenth at gcc dot gnu.org
Status|UNCONFIRMED |ASSIGNED
Ever confirmed|0 |1
Priority|P3 |P2
--- Comment #3 from Richard Biener <rguenth at gcc dot gnu.org> ---
Hmm, OK, it was a backport.. I'll see.
^ permalink raw reply [flat|nested] 11+ messages in thread
* [Bug tree-optimization/113896] [12 Regression] Assigning array elements in the wrong order after floating point optimization since r12-8841
2024-02-13 0:00 [Bug c++/113896] New: Assigning array elements in the wrong order after floating point optimization noobie-iv at mail dot ru
` (3 preceding siblings ...)
2024-02-13 8:43 ` rguenth at gcc dot gnu.org
@ 2024-02-13 12:36 ` rguenth at gcc dot gnu.org
2024-02-13 12:42 ` cvs-commit at gcc dot gnu.org
` (4 subsequent siblings)
9 siblings, 0 replies; 11+ messages in thread
From: rguenth at gcc dot gnu.org @ 2024-02-13 12:36 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113896
--- Comment #4 from Richard Biener <rguenth at gcc dot gnu.org> ---
I have a bit of a deja-vu here. The SLP permute optimization phase was
rewritten for GCC 13, the following fixes the latent issue for GCC 12:
diff --git a/gcc/tree-vect-slp.cc b/gcc/tree-vect-slp.cc
index af477c31aa3..b3e3d9e7009 100644
--- a/gcc/tree-vect-slp.cc
+++ b/gcc/tree-vect-slp.cc
@@ -4058,6 +4058,15 @@ vect_optimize_slp (vec_info *vinfo)
{
/* Preserve the special VEC_PERM we use to shield existing
vector defs from the rest. But make it a no-op. */
+ auto_vec<stmt_vec_info, 64> saved;
+ saved.create (SLP_TREE_SCALAR_STMTS (old).length ());
+ for (unsigned i = 0;
+ i < SLP_TREE_SCALAR_STMTS (old).length (); ++i)
+ saved.quick_push (SLP_TREE_SCALAR_STMTS (old)[i]);
+ for (unsigned i = 0;
+ i < SLP_TREE_SCALAR_STMTS (old).length (); ++i)
+ SLP_TREE_SCALAR_STMTS (old)[i]
+ = saved[SLP_TREE_LANE_PERMUTATION (old)[i].second];
unsigned i = 0;
for (std::pair<unsigned, unsigned> &p
: SLP_TREE_LANE_PERMUTATION (old))
^ permalink raw reply [flat|nested] 11+ messages in thread
* [Bug tree-optimization/113896] [12 Regression] Assigning array elements in the wrong order after floating point optimization since r12-8841
2024-02-13 0:00 [Bug c++/113896] New: Assigning array elements in the wrong order after floating point optimization noobie-iv at mail dot ru
` (4 preceding siblings ...)
2024-02-13 12:36 ` rguenth at gcc dot gnu.org
@ 2024-02-13 12:42 ` cvs-commit at gcc dot gnu.org
2024-02-13 12:48 ` cvs-commit at gcc dot gnu.org
` (3 subsequent siblings)
9 siblings, 0 replies; 11+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2024-02-13 12:42 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113896
--- Comment #5 from GCC 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:4a1cd5560b9b545eb848eb1d1e06d345fb606f76
commit r14-8957-g4a1cd5560b9b545eb848eb1d1e06d345fb606f76
Author: Richard Biener <rguenther@suse.de>
Date: Tue Feb 13 13:39:29 2024 +0100
tree-optimization/113896 - testcase for fixed PR
The SLP permute optimization rewrite fixed this.
PR tree-optimization/113896
* g++.dg/torture/pr113896.C: New testcase.
^ permalink raw reply [flat|nested] 11+ messages in thread
* [Bug tree-optimization/113896] [12 Regression] Assigning array elements in the wrong order after floating point optimization since r12-8841
2024-02-13 0:00 [Bug c++/113896] New: Assigning array elements in the wrong order after floating point optimization noobie-iv at mail dot ru
` (5 preceding siblings ...)
2024-02-13 12:42 ` cvs-commit at gcc dot gnu.org
@ 2024-02-13 12:48 ` cvs-commit at gcc dot gnu.org
2024-02-14 11:43 ` cvs-commit at gcc dot gnu.org
` (2 subsequent siblings)
9 siblings, 0 replies; 11+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2024-02-13 12:48 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113896
--- Comment #6 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-13 branch has been updated by Richard Biener
<rguenth@gcc.gnu.org>:
https://gcc.gnu.org/g:8a93dc34e90cd8e2bb073f8fd48f671aea62d965
commit r13-8323-g8a93dc34e90cd8e2bb073f8fd48f671aea62d965
Author: Richard Biener <rguenther@suse.de>
Date: Tue Feb 13 13:39:29 2024 +0100
tree-optimization/113896 - testcase for fixed PR
The SLP permute optimization rewrite fixed this.
PR tree-optimization/113896
* g++.dg/torture/pr113896.C: New testcase.
(cherry picked from commit 4a1cd5560b9b545eb848eb1d1e06d345fb606f76)
^ permalink raw reply [flat|nested] 11+ messages in thread
* [Bug tree-optimization/113896] [12 Regression] Assigning array elements in the wrong order after floating point optimization since r12-8841
2024-02-13 0:00 [Bug c++/113896] New: Assigning array elements in the wrong order after floating point optimization noobie-iv at mail dot ru
` (6 preceding siblings ...)
2024-02-13 12:48 ` cvs-commit at gcc dot gnu.org
@ 2024-02-14 11:43 ` cvs-commit at gcc dot gnu.org
2024-02-14 11:43 ` rguenth at gcc dot gnu.org
2024-02-15 3:16 ` noobie-iv at mail dot ru
9 siblings, 0 replies; 11+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2024-02-14 11:43 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113896
--- Comment #7 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-12 branch has been updated by Richard Biener
<rguenth@gcc.gnu.org>:
https://gcc.gnu.org/g:2f16c53558d01135f0f78cf78a2f722b774684d7
commit r12-10155-g2f16c53558d01135f0f78cf78a2f722b774684d7
Author: Richard Biener <rguenther@suse.de>
Date: Tue Feb 13 13:43:44 2024 +0100
tree-optimization/113896 - reduction of permuted external vector
The following fixes eliding of the permutation of a BB reduction
of an existing vector which breaks materialization of live lanes
as we fail to permute the SLP_TREE_SCALAR_STMTS vector.
PR tree-optimization/113896
* tree-vect-slp.cc (vect_optimize_slp): Permute
SLP_TREE_SCALAR_STMTS when eliding a permuation in a
VEC_PERM node we need to preserve because it wraps an
extern vector.
* g++.dg/torture/pr113896.C: New testcase.
^ permalink raw reply [flat|nested] 11+ messages in thread
* [Bug tree-optimization/113896] [12 Regression] Assigning array elements in the wrong order after floating point optimization since r12-8841
2024-02-13 0:00 [Bug c++/113896] New: Assigning array elements in the wrong order after floating point optimization noobie-iv at mail dot ru
` (7 preceding siblings ...)
2024-02-14 11:43 ` cvs-commit at gcc dot gnu.org
@ 2024-02-14 11:43 ` rguenth at gcc dot gnu.org
2024-02-15 3:16 ` noobie-iv at mail dot ru
9 siblings, 0 replies; 11+ messages in thread
From: rguenth at gcc dot gnu.org @ 2024-02-14 11:43 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113896
Richard Biener <rguenth at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|ASSIGNED |RESOLVED
Resolution|--- |FIXED
Known to work| |12.3.1
--- Comment #8 from Richard Biener <rguenth at gcc dot gnu.org> ---
Fixed.
^ permalink raw reply [flat|nested] 11+ messages in thread
* [Bug tree-optimization/113896] [12 Regression] Assigning array elements in the wrong order after floating point optimization since r12-8841
2024-02-13 0:00 [Bug c++/113896] New: Assigning array elements in the wrong order after floating point optimization noobie-iv at mail dot ru
` (8 preceding siblings ...)
2024-02-14 11:43 ` rguenth at gcc dot gnu.org
@ 2024-02-15 3:16 ` noobie-iv at mail dot ru
9 siblings, 0 replies; 11+ messages in thread
From: noobie-iv at mail dot ru @ 2024-02-15 3:16 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113896
--- Comment #9 from noobie-iv at mail dot ru ---
I confirm that the original bug in the scantailor-experimental project was also
fixed by commit 2f16c53558d01135f0f78cf78a2f722b774684d7.
^ permalink raw reply [flat|nested] 11+ messages in thread