aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-sra.c
diff options
context:
space:
mode:
authorMartin Jambor <mjambor@suse.cz>2013-05-23 15:20:41 +0200
committerMartin Jambor <jamborm@gcc.gnu.org>2013-05-23 15:20:41 +0200
commit7d2fb5244ba6c3c48222327e8ebc6883fa5c819e (patch)
treeb293e3ccbf8e0a029d6133c38c71e73dd385f953 /gcc/tree-sra.c
parent877251155ba19212871966c65f4a283907eeb54e (diff)
downloadgcc-7d2fb5244ba6c3c48222327e8ebc6883fa5c819e.zip
gcc-7d2fb5244ba6c3c48222327e8ebc6883fa5c819e.tar.gz
gcc-7d2fb5244ba6c3c48222327e8ebc6883fa5c819e.tar.bz2
re PR middle-end/57347 (wrong code for bitfield on x86_64-linux at -Os and above)
2013-05-22 Martin Jambor <mjambor@suse.cz> PR middle-end/57347 * tree.h (contains_bitfld_component_ref_p): Declare. * tree-sra.c (contains_bitfld_comp_ref_p): Move... * tree.c (contains_bitfld_component_ref_p): ...here. Adjust its caller. * ipa-prop.c (determine_known_aggregate_parts): Check that LHS does not access a bit-field. Assert all final offsets are byte-aligned. testsuite/ * gcc.dg/ipa/pr57347.c: New test. From-SVN: r199252
Diffstat (limited to 'gcc/tree-sra.c')
-rw-r--r--gcc/tree-sra.c19
1 files changed, 1 insertions, 18 deletions
diff --git a/gcc/tree-sra.c b/gcc/tree-sra.c
index c430c54..7e950ae 100644
--- a/gcc/tree-sra.c
+++ b/gcc/tree-sra.c
@@ -2998,23 +2998,6 @@ get_repl_default_def_ssa_name (struct access *racc)
return get_or_create_ssa_default_def (cfun, racc->replacement_decl);
}
-/* Return true if REF has a COMPONENT_REF with a bit-field field declaration
- somewhere in it. */
-
-static inline bool
-contains_bitfld_comp_ref_p (const_tree ref)
-{
- while (handled_component_p (ref))
- {
- if (TREE_CODE (ref) == COMPONENT_REF
- && DECL_BIT_FIELD (TREE_OPERAND (ref, 1)))
- return true;
- ref = TREE_OPERAND (ref, 0);
- }
-
- return false;
-}
-
/* Return true if REF has an VIEW_CONVERT_EXPR or a COMPONENT_REF with a
bit-field field declaration somewhere in it. */
@@ -3110,7 +3093,7 @@ sra_modify_assign (gimple *stmt, gimple_stmt_iterator *gsi)
??? This should move to fold_stmt which we simply should
call after building a VIEW_CONVERT_EXPR here. */
if (AGGREGATE_TYPE_P (TREE_TYPE (lhs))
- && !contains_bitfld_comp_ref_p (lhs))
+ && !contains_bitfld_component_ref_p (lhs))
{
lhs = build_ref_for_model (loc, lhs, 0, racc, gsi, false);
gimple_assign_set_lhs (*stmt, lhs);