[1/2] More abstraction penalty removal for PR92645

Message ID nycvar.YFH.7.76.1912021601090.5566@zhemvz.fhfr.qr
State New
Headers show
Series
  • [1/2] More abstraction penalty removal for PR92645
Related show

Commit Message

Richard Biener Dec. 2, 2019, 3:02 p.m.
The following avoids a spurious BIT_INSERT_EXPR when rewriting
a decl into SSA form.

Bootstrap & regtest running on x86_64-unknown-linux-gnu.

Richard.

2019-11-02  Richard Biener  <rguenther@suse.de>

	PR tree-optimization/92645
	* tree-ssa.c (execute_update_addresses_taken): Avoid representing
	a full def of a vector via a BIT_INSERT_EXPR.

Patch

Index: gcc/tree-ssa.c
===================================================================
--- gcc/tree-ssa.c	(revision 278893)
+++ gcc/tree-ssa.c	(working copy)
@@ -1899,6 +1899,11 @@  execute_update_addresses_taken (void)
 		    && bitmap_bit_p (suitable_for_renaming, DECL_UID (sym))
 		    && VECTOR_TYPE_P (TREE_TYPE (sym))
 		    && TYPE_MODE (TREE_TYPE (sym)) != BLKmode
+		    /* If it is a full replacement we can do better below.  */
+		    && maybe_ne (wi::to_poly_offset
+				   (TYPE_SIZE_UNIT (TREE_TYPE (lhs))),
+				 wi::to_poly_offset
+                                   (TYPE_SIZE_UNIT (TREE_TYPE (sym))))
 		    && known_ge (mem_ref_offset (lhs), 0)
 		    && known_gt (wi::to_poly_offset
 				   (TYPE_SIZE_UNIT (TREE_TYPE (sym))),