aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-sra.c
diff options
context:
space:
mode:
authorRichard Guenther <rguenther@suse.de>2012-01-23 11:59:53 +0000
committerRichard Guenther <rguenther@suse.de>2012-01-23 11:59:53 +0000
commit9e4e9b03efe7e8a70fa9f435e767f5e14c8bd371 (patch)
treed7ac089a19b8b5ac63d48e21b3bf6072f31e9c4f /gcc/tree-sra.c
parent720a912976b02618aa866d7da3b4c71409565282 (diff)
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. git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@183429 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/tree-sra.c')
-rw-r--r--gcc/tree-sra.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/gcc/tree-sra.c b/gcc/tree-sra.c
index 9c2d13875d9..f4146b2acbc 100644
--- a/gcc/tree-sra.c
+++ b/gcc/tree-sra.c
@@ -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;