diff options
author | rsandifo <rsandifo@138bc75d-0d04-0410-961f-82ee72b054a4> | 2011-09-27 17:18:22 +0000 |
---|---|---|
committer | rsandifo <rsandifo@138bc75d-0d04-0410-961f-82ee72b054a4> | 2011-09-27 17:18:22 +0000 |
commit | cdb0a2c3023a7467b5265410590cee01db0f2d71 (patch) | |
tree | 0a2b2cb26e7c1a8e6b45253ec02a6781882e2232 | |
parent | 0217cfffc7f489491b9929313d263c26dfdd9b13 (diff) | |
download | gcc-cdb0a2c3023a7467b5265410590cee01db0f2d71.tar.gz |
gcc/
PR middle-end/50386
PR middle-end/50326
* tree-sra.c (build_ref_for_model): Use the type of the field as
the type of the COMPONENT_REF.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@179285 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r-- | gcc/ChangeLog | 7 | ||||
-rw-r--r-- | gcc/tree-sra.c | 2 |
2 files changed, 8 insertions, 1 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index dbe8a600b33..585813806e5 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,10 @@ +2011-09-27 Richard Sandiford <rdsandiford@googlemail.com> + + PR middle-end/50386 + PR middle-end/50326 + * tree-sra.c (build_ref_for_model): Use the type of the field as + the type of the COMPONENT_REF. + 2011-09-27 Jeff Law <law@redhat.com> * ifcvt.c (cheap_bb_rtx_cost_p): Add SCALE argument. Scale diff --git a/gcc/tree-sra.c b/gcc/tree-sra.c index c85a7f51206..39d0278cf70 100644 --- a/gcc/tree-sra.c +++ b/gcc/tree-sra.c @@ -1504,7 +1504,7 @@ build_ref_for_model (location_t loc, tree base, HOST_WIDE_INT offset, offset -= TREE_INT_CST_LOW (DECL_FIELD_BIT_OFFSET (fld)); exp_type = TREE_TYPE (TREE_OPERAND (model->expr, 0)); t = build_ref_for_offset (loc, base, offset, exp_type, gsi, insert_after); - return fold_build3_loc (loc, COMPONENT_REF, model->type, t, fld, + return fold_build3_loc (loc, COMPONENT_REF, TREE_TYPE (fld), t, fld, TREE_OPERAND (model->expr, 2)); } else |