From 191879f9c2ca1c70d34acf91337bdf7bc3229eed Mon Sep 17 00:00:00 2001 From: Richard Guenther Date: Mon, 23 Jan 2012 11:59:53 +0000 Subject: [PATCH] re PR middle-end/51895 (ICE in simplify_subreg) 2012-01-23 Richard Guenther PR tree-optimization/51895 * tree-sra.c (decide_one_param_reduction): Avoid sub-optimal parameter decomposition into BLKmode components. From-SVN: r183429 --- gcc/ChangeLog | 6 ++++++ gcc/tree-sra.c | 7 +++++++ 2 files changed, 13 insertions(+) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index b953cd04d71..c0280874d3c 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2012-01-23 Richard Guenther + + PR tree-optimization/51895 + * tree-sra.c (decide_one_param_reduction): Avoid sub-optimal + parameter decomposition into BLKmode components. + 2012-01-23 Eric Botcazou * tree-ssa-structalias.c (intra_create_variable_infos): Do not create 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;