Commit 4dfb8a2a by Jakub Jelinek Committed by Jakub Jelinek

re PR tree-optimization/77901 (ICE in tree-sse-reassoc,c:2881)

	PR tree-optimization/77901
	* tree-ssa-reassoc.c (optimize_range_tests_var_bound): Only optimize
	if ranges[i].exp is SSA_NAME when looking for >= and only when
	ranges[i].exp is NULL or SSA_NAME when looking for the other
	comparison.

	* gcc.c-torture/compile/pr77901.c: New test.

From-SVN: r240899
parent 67b97478
2016-10-09 Jakub Jelinek <jakub@redhat.com>
PR tree-optimization/77901
* tree-ssa-reassoc.c (optimize_range_tests_var_bound): Only optimize
if ranges[i].exp is SSA_NAME when looking for >= and only when
ranges[i].exp is NULL or SSA_NAME when looking for the other
comparison.
2016-10-09 Prathamesh Kulkarni <prathamesh.kulkarni@linaro.org> 2016-10-09 Prathamesh Kulkarni <prathamesh.kulkarni@linaro.org>
* ipa-cp.c (ipcp_alignment_lattice): Remove. * ipa-cp.c (ipcp_alignment_lattice): Remove.
......
2016-10-09 Jakub Jelinek <jakub@redhat.com>
PR tree-optimization/77901
* gcc.c-torture/compile/pr77901.c: New test.
2016-10-09 Prathamesh Kulkarni <prathamesh.kulkarni@linaro.org> 2016-10-09 Prathamesh Kulkarni <prathamesh.kulkarni@linaro.org>
* gcc.dg/ipa/propalign-1.c: Adjust scan-ipa-dump. * gcc.dg/ipa/propalign-1.c: Adjust scan-ipa-dump.
......
/* PR tree-optimization/77901 */
void bar (void);
void
foo (int *x, long *y)
{
if (*y && *x != 10 && *x != 12 && *y >= 0)
bar ();
}
...@@ -2846,7 +2846,9 @@ optimize_range_tests_var_bound (enum tree_code opcode, int first, int length, ...@@ -2846,7 +2846,9 @@ optimize_range_tests_var_bound (enum tree_code opcode, int first, int length,
for (i = first; i < length; i++) for (i = first; i < length; i++)
{ {
if (ranges[i].exp == NULL_TREE || !ranges[i].in_p) if (ranges[i].exp == NULL_TREE
|| TREE_CODE (ranges[i].exp) != SSA_NAME
|| !ranges[i].in_p)
continue; continue;
tree type = TREE_TYPE (ranges[i].exp); tree type = TREE_TYPE (ranges[i].exp);
...@@ -2878,6 +2880,8 @@ optimize_range_tests_var_bound (enum tree_code opcode, int first, int length, ...@@ -2878,6 +2880,8 @@ optimize_range_tests_var_bound (enum tree_code opcode, int first, int length,
tree rhs1, rhs2; tree rhs1, rhs2;
if (ranges[i].exp) if (ranges[i].exp)
{ {
if (TREE_CODE (ranges[i].exp) != SSA_NAME)
continue;
stmt = SSA_NAME_DEF_STMT (ranges[i].exp); stmt = SSA_NAME_DEF_STMT (ranges[i].exp);
if (!is_gimple_assign (stmt)) if (!is_gimple_assign (stmt))
continue; continue;
......
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