Commit 3efe2e2c by Jakub Jelinek Committed by Jakub Jelinek

re PR tree-optimization/60559 (g++.dg/vect/pr60023.cc fails with -fno-tree-dce (ICE))

	PR tree-optimization/60559
	* vectorizable_mask_load_store): Replace scalar MASK_LOAD
	with build_zero_cst assignment.

	* g++.dg/vect/pr60559.cc: New test.

From-SVN: r208676
parent 15df2655
2014-03-19 Jakub Jelinek <jakub@redhat.com>
PR tree-optimization/60559
* vectorizable_mask_load_store): Replace scalar MASK_LOAD
with build_zero_cst assignment.
2014-03-18 Kai Tietz <ktietz@redhat.com> 2014-03-18 Kai Tietz <ktietz@redhat.com>
PR rtl-optimization/56356 PR rtl-optimization/56356
......
2014-03-19 Jakub Jelinek <jakub@redhat.com>
PR tree-optimization/60559
* g++.dg/vect/pr60559.cc: New test.
2014-03-18 Ian Lance Taylor <iant@google.com> 2014-03-18 Ian Lance Taylor <iant@google.com>
PR target/60563 PR target/60563
......
// PR tree-optimization/60559
// { dg-do compile }
// { dg-additional-options "-O3 -std=c++11 -fnon-call-exceptions -fno-tree-dce" }
// { dg-additional-options "-mavx2" { target { i?86-*-* x86_64-*-* } } }
#include "pr60023.cc"
// { dg-final { cleanup-tree-dump "vect" } }
...@@ -2038,6 +2038,15 @@ vectorizable_mask_load_store (gimple stmt, gimple_stmt_iterator *gsi, ...@@ -2038,6 +2038,15 @@ vectorizable_mask_load_store (gimple stmt, gimple_stmt_iterator *gsi,
STMT_VINFO_RELATED_STMT (prev_stmt_info) = new_stmt; STMT_VINFO_RELATED_STMT (prev_stmt_info) = new_stmt;
prev_stmt_info = vinfo_for_stmt (new_stmt); prev_stmt_info = vinfo_for_stmt (new_stmt);
} }
/* Ensure that even with -fno-tree-dce the scalar MASK_LOAD is removed
from the IL. */
tree lhs = gimple_call_lhs (stmt);
new_stmt = gimple_build_assign (lhs, build_zero_cst (TREE_TYPE (lhs)));
set_vinfo_for_stmt (new_stmt, stmt_info);
set_vinfo_for_stmt (stmt, NULL);
STMT_VINFO_STMT (stmt_info) = new_stmt;
gsi_replace (gsi, new_stmt, true);
return true; return true;
} }
else if (is_store) else if (is_store)
...@@ -2149,6 +2158,18 @@ vectorizable_mask_load_store (gimple stmt, gimple_stmt_iterator *gsi, ...@@ -2149,6 +2158,18 @@ vectorizable_mask_load_store (gimple stmt, gimple_stmt_iterator *gsi,
} }
} }
if (!is_store)
{
/* Ensure that even with -fno-tree-dce the scalar MASK_LOAD is removed
from the IL. */
tree lhs = gimple_call_lhs (stmt);
new_stmt = gimple_build_assign (lhs, build_zero_cst (TREE_TYPE (lhs)));
set_vinfo_for_stmt (new_stmt, stmt_info);
set_vinfo_for_stmt (stmt, NULL);
STMT_VINFO_STMT (stmt_info) = new_stmt;
gsi_replace (gsi, new_stmt, true);
}
return true; return true;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment