This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[PATCH] Disable aggregate jump functions for bit-field stores
- From: Martin Jambor <mjambor at suse dot cz>
- To: GCC Patches <gcc-patches at gcc dot gnu dot org>
- Cc: Jan Hubicka <hubicka at ucw dot cz>
- Date: Sun, 4 Nov 2012 23:39:46 +0100
- Subject: [PATCH] Disable aggregate jump functions for bit-field stores
Hi,
the patch below disables generation of aggregate jump functions from
bit-field stores because currently we depend on type size of the value
to determine the size of the stored value and that does not work with
bit-fields, making it impossible for IPA-CP to organize them in their
lattices.
If we ever decide aggregate jump functions for bit-fields are worth
the hassle, we might remove this limitation by storing and streaming
the size of the memory reference alongside the offset in the jump
functions (and IPA-CP lattices).
Bootstrapped and tested on x86_64-linux, needed for the aggregate
IPA-CP. OK for trunk?
Thanks,
Martin
2012-11-02 Martin Jambor <mjambor@suse.cz>
* ipa-prop.c (determine_known_aggregate_parts): Do not create
aggregate jump functions for bit-fields.
Index: src/gcc/ipa-prop.c
===================================================================
--- src.orig/gcc/ipa-prop.c
+++ src/gcc/ipa-prop.c
@@ -1295,7 +1295,10 @@ determine_known_aggregate_parts (gimple
lhs = gimple_assign_lhs (stmt);
rhs = gimple_assign_rhs1 (stmt);
- if (!is_gimple_reg_type (rhs))
+ if (!is_gimple_reg_type (rhs)
+ || TREE_CODE (lhs) == BIT_FIELD_REF
+ || (TREE_CODE (lhs) == COMPONENT_REF
+ && DECL_BIT_FIELD (TREE_OPERAND (lhs, 1))))
break;
lhs_base = get_ref_base_and_extent (lhs, &lhs_offset, &lhs_size,