This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[PATCH] Restrict jump threading statement simplifier to scalar types (PR71077)
- From: Patrick Palka <patrick at parcs dot ath dot cx>
- To: gcc-patches at gcc dot gnu dot org
- Cc: ysrumyan at gmail dot com, Patrick Palka <patrick at parcs dot ath dot cx>
- Date: Thu, 18 Aug 2016 14:25:18 -0400
- Subject: [PATCH] Restrict jump threading statement simplifier to scalar types (PR71077)
- Authentication-results: sourceware.org; auth=none
In comment #5 Yuri reports that r235653 introduces a runtime failure for
176.gcc which I guess is caused by the combining step in
simplify_control_stmt_condition_1() not behaving properly on operands of
type VECTOR_TYPE. I'm a bit stumped as to why it mishandles
VECTOR_TYPEs because the logic should be generic enough to support them
as well. But it was confirmed that restricting the combining step to
operands of scalar type fixes the runtime failure so here is a patch
that does this. Does this look OK to commit after bootstrap +
regtesting on x86_64-pc-linux-gnu?
gcc/ChangeLog:
PR tree-optimization/71077
* tree-ssa-threadedge.c (simplify_control_stmt_condition_1):
Perform the combining step only if the operands have an integral
or a pointer type.
---
gcc/tree-ssa-threadedge.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/gcc/tree-ssa-threadedge.c b/gcc/tree-ssa-threadedge.c
index 170e456..a97c00c 100644
--- a/gcc/tree-ssa-threadedge.c
+++ b/gcc/tree-ssa-threadedge.c
@@ -577,6 +577,9 @@ simplify_control_stmt_condition_1 (edge e,
if (handle_dominating_asserts
&& (cond_code == EQ_EXPR || cond_code == NE_EXPR)
&& TREE_CODE (op0) == SSA_NAME
+ /* ??? Vector types are mishandled here. */
+ && (INTEGRAL_TYPE_P (TREE_TYPE (op0))
+ || POINTER_TYPE_P (TREE_TYPE (op0)))
&& integer_zerop (op1))
{
gimple *def_stmt = SSA_NAME_DEF_STMT (op0);
--
2.9.3.650.g20ba99f