re PR middle-end/51895 (ICE in simplify_subreg)
authorRichard Guenther <rguenther@suse.de>
Mon, 23 Jan 2012 11:59:53 +0000 (11:59 +0000)
committerRichard Biener <rguenth@gcc.gnu.org>
Mon, 23 Jan 2012 11:59:53 +0000 (11:59 +0000)
2012-01-23  Richard Guenther  <rguenther@suse.de>

PR tree-optimization/51895
* tree-sra.c (decide_one_param_reduction): Avoid sub-optimal
parameter decomposition into BLKmode components.

From-SVN: r183429

gcc/ChangeLog
gcc/tree-sra.c

index b953cd04d716a166a5ac1a255a1a8a3c1b7436a7..c0280874d3c5473ba2284ddf686bc6a5563f5e3e 100644 (file)
@@ -1,3 +1,9 @@
+2012-01-23  Richard Guenther  <rguenther@suse.de>
+
+       PR tree-optimization/51895
+       * tree-sra.c (decide_one_param_reduction): Avoid sub-optimal
+       parameter decomposition into BLKmode components.
+
 2012-01-23  Eric Botcazou  <ebotcazou@adacore.com>
 
        * tree-ssa-structalias.c (intra_create_variable_infos): Do not create
index 9c2d13875d9666e8331c673d76217cf1dbd159e1..f4146b2acbccd95c0bb3b8963db083ac912ea716 100644 (file)
@@ -3914,6 +3914,13 @@ decide_one_param_reduction (struct access *repr)
       if (by_ref && repr->non_addressable)
        return 0;
 
+      /* Do not decompose a non-BLKmode param in a way that would
+         create BLKmode params.  Especially for by-reference passing
+        (thus, pointer-type param) this is hardly worthwhile.  */
+      if (DECL_MODE (parm) != BLKmode
+         && TYPE_MODE (repr->type) == BLKmode)
+       return 0;
+
       if (!by_ref || (!repr->grp_maybe_modified
                      && !repr->grp_not_necessarilly_dereferenced))
        total_size += repr->size;