Skip to content
Snippets Groups Projects
Commit 26295a06 authored by Richard Biener's avatar Richard Biener
Browse files

Treat ADDR_EXPR and CONSTRUCTOR as GIMPLE/GENERIC magically

The following allows to match ADDR_EXPR for both the invariant
&a.b case as well as the &p->d case in a separate definition
transparently.  This also allows to remove the hack we employ
for CONSTRUCTOR which we handle for example with

 (match vec_same_elem_p
  CONSTRUCTOR@0
  (if (TREE_CODE (@0) == SSA_NAME
       && uniform_vector_p (gimple_assign_rhs1 (SSA_NAME_DEF_STMT (@0))))))

Note CONSTUCTORs always appear as separate definition in GIMPLE,
but I continue to play safe and ADDR_EXPRs are now matched in
both places where previously ADDR_EXPR@0 would have missed
the &p->x case.

This is a prerequesite for the PR89317 fix.

	* genmatch.cc (dt_node::gen_kids): Handle ADDR_EXPR in both
	the GENERIC and GIMPLE op position.
	(dt_simplify::gen): Capture both GENERIC and GIMPLE op
	position for ADDR_EXPR and CONSTRUCTOR.
	* match.pd: Simplify CONSTRUCTOR leaf handling.

	* gcc.dg/tree-ssa/forwprop-3.c: Adjust.
	* g++.dg/tree-ssa/pr31146-2.C: Likewise.
parent f8d136e5
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment