summaryrefslogtreecommitdiff
path: root/gcc/alias.c
diff options
context:
space:
mode:
authorEric Botcazou <ebotcazou@adacore.com>2012-11-23 16:00:26 +0000
committerEric Botcazou <ebotcazou@gcc.gnu.org>2012-11-23 16:00:26 +0000
commitee88e690a27cfbe3cbb2216e50dec455754bc9a2 (patch)
treea14567480c026683cf12be27a8dd0c65837a7be2 /gcc/alias.c
parentafa22e29eed02941a7d6d21f539ce5fb8716eba1 (diff)
downloadgcc-ee88e690a27cfbe3cbb2216e50dec455754bc9a2.tar.gz
re PR rtl-optimization/55388 (ICE in int_mode_for_mode at stor-layout.c:423)
PR rtl-optimization/55388 * alias.c (nonoverlapping_component_refs_p): Handle bitfields. * emit-rtl.c (adjust_address_1): Deal with VOIDmode early. * expmed.c (store_bit_field): Turn the call to adjust_address into a call to adjust_bitfield_address_size. From-SVN: r193760
Diffstat (limited to 'gcc/alias.c')
-rw-r--r--gcc/alias.c19
1 files changed, 14 insertions, 5 deletions
diff --git a/gcc/alias.c b/gcc/alias.c
index 2ef13cc755b..21daa5fdb4f 100644
--- a/gcc/alias.c
+++ b/gcc/alias.c
@@ -2236,11 +2236,20 @@ nonoverlapping_component_refs_p (const_rtx rtlx, const_rtx rtly)
return false;
found:
- /* If we're left with accessing different fields of a structure,
- then no overlap. */
- if (TREE_CODE (typex) == RECORD_TYPE
- && fieldx != fieldy)
- return true;
+ /* If we're left with accessing different fields of a structure, then no
+ possible overlap, unless they are both true bitfields, i.e. bitfields
+ for which the size isn't a multiple of the (memory) unit. */
+ if (TREE_CODE (typex) == RECORD_TYPE && fieldx != fieldy)
+ {
+ if (!DECL_BIT_FIELD (fieldx) || !DECL_BIT_FIELD (fieldy))
+ return true;
+
+ if ((tree_low_cst (DECL_SIZE (fieldx), 1) % BITS_PER_UNIT) == 0
+ || (tree_low_cst (DECL_SIZE (fieldy), 1) % BITS_PER_UNIT) == 0)
+ return true;
+
+ return false;
+ }
/* The comparison on the current field failed. If we're accessing
a very nested structure, look at the next outer level. */