diff mbox

[PR68659] Handle addr_expr and component_ref in graphite-ast-to-ast

Message ID 56D562F5.2090608@mentor.com
State New
Headers show

Commit Message

Tom de Vries March 1, 2016, 9:37 a.m. UTC
Hi,

this patch fixes graphite PR68659, which is a 6 regression.

The patch fixes two things:
- by handling new_expr == NULL_TREE in collect_all_ssa_names, it handles a
   COMPONENT_REF where operand 2 is NULL_TREE.
- it handles an ADDR_EXPR in get_new_name.
Together, they allow the currently failing test-case 
gcc.dg/graphite/id-pr45230-1.c to pass.

Bootstrapped and reg-tested on x86_64.

OK for stage4 trunk?

Thanks,
- Tom

Comments

Richard Biener March 1, 2016, 9:45 a.m. UTC | #1
On Tue, 1 Mar 2016, Tom de Vries wrote:

> Hi,
> 
> this patch fixes graphite PR68659, which is a 6 regression.
> 
> The patch fixes two things:
> - by handling new_expr == NULL_TREE in collect_all_ssa_names, it handles a
>   COMPONENT_REF where operand 2 is NULL_TREE.
> - it handles an ADDR_EXPR in get_new_name.
> Together, they allow the currently failing test-case
> gcc.dg/graphite/id-pr45230-1.c to pass.
> 
> Bootstrapped and reg-tested on x86_64.
> 
> OK for stage4 trunk?

@@ -1804,6 +1806,9 @@ get_new_name (basic_block new_bb, tree op,
   if (is_constant (op))
     return op;
 
+  if (TREE_CODE (op) == ADDR_EXPR)
+    return op;
+
   return get_rename (new_bb, op, old_bb, phi_kind);
 }


please instead change the is_constant (op) condition to
TREE_CODE (op) != SSA_NAME.

Thanks,
Richard.
diff mbox

Patch

Handle addr_expr and component_ref in graphite-ast-to-ast

2016-03-01  Tom de Vries  <tom@codesourcery.com>

	PR tree-optimization/68659
	* graphite-isl-ast-to-gimple.c (collect_all_ssa_names): Handle
	new_expr == NULL_TREE.
	(get_new_name): Handle ADDR_EXPR.

---
 gcc/graphite-isl-ast-to-gimple.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/gcc/graphite-isl-ast-to-gimple.c b/gcc/graphite-isl-ast-to-gimple.c
index d3614e4..102306b 100644
--- a/gcc/graphite-isl-ast-to-gimple.c
+++ b/gcc/graphite-isl-ast-to-gimple.c
@@ -1403,6 +1403,8 @@  gsi_insert_earliest (gimple_seq seq)
 void translate_isl_ast_to_gimple::
 collect_all_ssa_names (tree new_expr, vec<tree> *vec_ssa)
 {
+  if (new_expr == NULL_TREE)
+    return;
 
   /* Rename all uses in new_expr.  */
   if (TREE_CODE (new_expr) == SSA_NAME)
@@ -1804,6 +1806,9 @@  get_new_name (basic_block new_bb, tree op,
   if (is_constant (op))
     return op;
 
+  if (TREE_CODE (op) == ADDR_EXPR)
+    return op;
+
   return get_rename (new_bb, op, old_bb, phi_kind);
 }