summaryrefslogtreecommitdiff
path: root/gcc/tree-vect-data-refs.c
diff options
context:
space:
mode:
authorjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>2014-02-06 10:59:30 +0000
committerjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>2014-02-06 10:59:30 +0000
commit53c3c39b96df9c6a6368bf0d6acfd28a7af3cb63 (patch)
tree8faccae71cd6a2e44fe26ea31084a5ffa6161541 /gcc/tree-vect-data-refs.c
parent1d7f9a873166b4ff11d97e026076b254e4444fb2 (diff)
downloadgcc-53c3c39b96df9c6a6368bf0d6acfd28a7af3cb63.tar.gz
PR middle-end/59150
* tree-vect-data-refs.c (vect_analyze_data_refs): For clobbers, call free_data_ref on the dr first, and before goto again also set dr to the next dr. For simd_lane_access, free old datarefs[i] before overwriting it. For get_vectype_for_scalar_type failure, don't free_data_ref if simd_lane_access. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@207551 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/tree-vect-data-refs.c')
-rw-r--r--gcc/tree-vect-data-refs.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/gcc/tree-vect-data-refs.c b/gcc/tree-vect-data-refs.c
index fa96be9e34b..78056ba1ac9 100644
--- a/gcc/tree-vect-data-refs.c
+++ b/gcc/tree-vect-data-refs.c
@@ -3297,12 +3297,13 @@ again:
clobber stmts during vectorization. */
if (gimple_clobber_p (stmt))
{
+ free_data_ref (dr);
if (i == datarefs.length () - 1)
{
datarefs.pop ();
break;
}
- datarefs[i] = datarefs.pop ();
+ datarefs[i] = dr = datarefs.pop ();
goto again;
}
@@ -3643,13 +3644,14 @@ again:
if (simd_lane_access)
{
STMT_VINFO_SIMD_LANE_ACCESS_P (stmt_info) = true;
+ free_data_ref (datarefs[i]);
datarefs[i] = dr;
}
/* Set vectype for STMT. */
scalar_type = TREE_TYPE (DR_REF (dr));
- STMT_VINFO_VECTYPE (stmt_info) =
- get_vectype_for_scalar_type (scalar_type);
+ STMT_VINFO_VECTYPE (stmt_info)
+ = get_vectype_for_scalar_type (scalar_type);
if (!STMT_VINFO_VECTYPE (stmt_info))
{
if (dump_enabled_p ())
@@ -3669,7 +3671,8 @@ again:
if (gather || simd_lane_access)
{
STMT_VINFO_DATA_REF (stmt_info) = NULL;
- free_data_ref (dr);
+ if (gather)
+ free_data_ref (dr);
}
return false;
}