tree-optimization/95576 - fix compare-debug issue with SLP vectorization
The following avoids leading debug stmts in BB vectorizer regions. 2020-06-10 Richard Biener <rguenther@suse.de> PR tree-optimization/95576 * tree-vect-slp.c (vect_slp_bb): Skip leading debug stmts. * g++.dg/vect/pr95576.cc: New testcase.
This commit is contained in:
parent
b5cebc9ab7
commit
36e95a9e53
|
@ -0,0 +1,23 @@
|
|||
// { dg-do compile }
|
||||
// { dg-additional-options "-O3 -fno-tree-forwprop -fcompare-debug" }
|
||||
|
||||
struct S {
|
||||
virtual ~S();
|
||||
struct S *s;
|
||||
virtual void m();
|
||||
int f;
|
||||
void *d;
|
||||
};
|
||||
|
||||
struct T : S {
|
||||
void m();
|
||||
};
|
||||
|
||||
S::~S() {
|
||||
if (s) {
|
||||
s->f = 0;
|
||||
s->d = __null;
|
||||
}
|
||||
}
|
||||
|
||||
void T::m() {}
|
|
@ -3316,7 +3316,12 @@ vect_slp_bb (basic_block bb)
|
|||
{
|
||||
gimple *stmt = gsi_stmt (gsi);
|
||||
if (is_gimple_debug (stmt))
|
||||
continue;
|
||||
{
|
||||
/* Skip leading debug stmts. */
|
||||
if (gsi_stmt (region_begin) == stmt)
|
||||
gsi_next (®ion_begin);
|
||||
continue;
|
||||
}
|
||||
insns++;
|
||||
|
||||
if (gimple_location (stmt) != UNKNOWN_LOCATION)
|
||||
|
@ -3325,6 +3330,8 @@ vect_slp_bb (basic_block bb)
|
|||
if (!vect_find_stmt_data_reference (NULL, stmt, &datarefs))
|
||||
break;
|
||||
}
|
||||
if (gsi_end_p (region_begin))
|
||||
break;
|
||||
|
||||
/* Skip leading unhandled stmts. */
|
||||
if (gsi_stmt (region_begin) == gsi_stmt (gsi))
|
||||
|
|
Loading…
Reference in New Issue