diff options
author | Jie Zhang <jie@codesourcery.com> | 2010-08-05 03:05:35 +0000 |
---|---|---|
committer | Jie Zhang <jiez@gcc.gnu.org> | 2010-08-05 03:05:35 +0000 |
commit | 36b86f4a54675e0d707a33e1bc605eb4d7e6139d (patch) | |
tree | 9e187d4ca7b2b2e716a05a1076c35b48a73d25c3 /gcc/tree-sra.c | |
parent | 370f330ff58ff6ec3504fd2886d79e15368f3143 (diff) | |
download | gcc-36b86f4a54675e0d707a33e1bc605eb4d7e6139d.zip gcc-36b86f4a54675e0d707a33e1bc605eb4d7e6139d.tar.gz gcc-36b86f4a54675e0d707a33e1bc605eb4d7e6139d.tar.bz2 |
re PR tree-optimization/45144 (SRA optimization issue of bit-field)
PR tree-optimization/45144
* tree-sra.c (type_consists_of_records_p): Return false
if the record contains bit-field.
testsuite/
PR tree-optimization/45144
* gcc.dg/tree-ssa/pr45144.c: New test.
From-SVN: r162897
Diffstat (limited to 'gcc/tree-sra.c')
-rw-r--r-- | gcc/tree-sra.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/gcc/tree-sra.c b/gcc/tree-sra.c index 372139f..d32bbeb 100644 --- a/gcc/tree-sra.c +++ b/gcc/tree-sra.c @@ -811,7 +811,7 @@ create_access (tree expr, gimple stmt, bool write) /* Return true iff TYPE is a RECORD_TYPE with fields that are either of gimple register types or (recursively) records with only these two kinds of fields. It also returns false if any of these records has a zero-size field as its - last field. */ + last field or has a bit-field. */ static bool type_consists_of_records_p (tree type) @@ -827,6 +827,9 @@ type_consists_of_records_p (tree type) { tree ft = TREE_TYPE (fld); + if (DECL_BIT_FIELD (fld)) + return false; + if (!is_gimple_reg_type (ft) && !type_consists_of_records_p (ft)) return false; |