Skip to content

Commit 338a5b0

Browse files
committed
vect: Fix scalar stmt typo in vect_optimize_slp_pass [PR106886]
Fix a stupid typo in my vect_optimize_slp_pass patch. gcc/ PR tree-optimization/106886 * tree-vect-slp.cc (vect_optimize_slp_pass::get_result_with_layout): Fix copying of scalar stmts. gcc/testsuite/ PR tree-optimization/106886 * gcc.dg/vect/bb-slp-layout-21.c: New test.
1 parent 0697bd0 commit 338a5b0

File tree

2 files changed

+24
-1
lines changed

2 files changed

+24
-1
lines changed
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
/* { dg-do compile } */
2+
/* { dg-additional-options "-march=bdver2" { target x86_64-*-* i?86-*-* } } */
3+
4+
int rl2GeomExport64_little_endian, rl2GeomExport64_little_endian_arch;
5+
void rl2GeomExport64(unsigned char *p, double value) {
6+
union {
7+
unsigned char byte[8];
8+
double double_value;
9+
} convert;
10+
convert.double_value = value;
11+
if (rl2GeomExport64_little_endian_arch)
12+
if (rl2GeomExport64_little_endian) {
13+
*(p + 7) = convert.byte[0];
14+
*(p + 6) = convert.byte[1];
15+
*(p + 5) = convert.byte[2];
16+
*(p + 4) = convert.byte[3];
17+
*(p + 3) = convert.byte[4];
18+
*(p + 2) = convert.byte[5];
19+
*(p + 1) = convert.byte[6];
20+
*p = convert.byte[7];
21+
} else
22+
*p = convert.byte[7];
23+
}

gcc/tree-vect-slp.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5212,7 +5212,7 @@ vect_optimize_slp_pass::get_result_with_layout (slp_tree node,
52125212
if (SLP_TREE_SCALAR_STMTS (node).length ())
52135213
{
52145214
auto &stmts = SLP_TREE_SCALAR_STMTS (result);
5215-
stmts.safe_splice (SLP_TREE_SCALAR_STMTS (result));
5215+
stmts.safe_splice (SLP_TREE_SCALAR_STMTS (node));
52165216
if (from_layout_i != 0)
52175217
vect_slp_permute (m_perms[from_layout_i], stmts, false);
52185218
if (to_layout_i != 0)

0 commit comments

Comments
 (0)