diff options
author | Bernd Edlinger <bernd.edlinger@hotmail.de> | 2013-09-20 14:10:14 +0000 |
---|---|---|
committer | Bernd Edlinger <edlinger@gcc.gnu.org> | 2013-09-20 14:10:14 +0000 |
commit | 59bb154488e270f67308538c5bba68e478b8ad9c (patch) | |
tree | 43f1354bf199e4c44aa97bee28fbf5063ffe50a7 /gcc/expr.c | |
parent | a54300190578a207d66e7db8931eabe936261c14 (diff) | |
download | gcc-59bb154488e270f67308538c5bba68e478b8ad9c.zip gcc-59bb154488e270f67308538c5bba68e478b8ad9c.tar.gz gcc-59bb154488e270f67308538c5bba68e478b8ad9c.tar.bz2 |
re PR middle-end/57748 (ICE when expanding assignment to unaligned zero-sized array)
2013-09-20 Bernd Edlinger <bernd.edlinger@hotmail.de>
PR middle-end/57748
* expr.c (expand_assignment): Remove misalignp code path.
testsuite/
PR middle-end/57748
* gcc.dg/torture/pr57748-1.c: New test.
* gcc.dg/torture/pr57748-2.c: New test.
From-SVN: r202778
Diffstat (limited to 'gcc/expr.c')
-rw-r--r-- | gcc/expr.c | 48 |
1 files changed, 1 insertions, 47 deletions
@@ -4709,8 +4709,6 @@ expand_assignment (tree to, tree from, bool nontemporal) int unsignedp; int volatilep = 0; tree tem; - bool misalignp; - rtx mem = NULL_RTX; push_temp_slots (); tem = get_inner_reference (to, &bitsize, &bitpos, &offset, &mode1, @@ -4720,40 +4718,7 @@ expand_assignment (tree to, tree from, bool nontemporal) && DECL_BIT_FIELD_TYPE (TREE_OPERAND (to, 1))) get_bit_range (&bitregion_start, &bitregion_end, to, &bitpos, &offset); - /* If we are going to use store_bit_field and extract_bit_field, - make sure to_rtx will be safe for multiple use. */ - mode = TYPE_MODE (TREE_TYPE (tem)); - if (TREE_CODE (tem) == MEM_REF - && mode != BLKmode - && ((align = get_object_alignment (tem)) - < GET_MODE_ALIGNMENT (mode)) - && ((icode = optab_handler (movmisalign_optab, mode)) - != CODE_FOR_nothing)) - { - struct expand_operand ops[2]; - - misalignp = true; - to_rtx = gen_reg_rtx (mode); - mem = expand_expr (tem, NULL_RTX, VOIDmode, EXPAND_WRITE); - - /* If the misaligned store doesn't overwrite all bits, perform - rmw cycle on MEM. */ - if (bitsize != GET_MODE_BITSIZE (mode)) - { - create_input_operand (&ops[0], to_rtx, mode); - create_fixed_operand (&ops[1], mem); - /* The movmisalign<mode> pattern cannot fail, else the assignment - would silently be omitted. */ - expand_insn (icode, 2, ops); - - mem = copy_rtx (mem); - } - } - else - { - misalignp = false; - to_rtx = expand_expr (tem, NULL_RTX, VOIDmode, EXPAND_WRITE); - } + to_rtx = expand_expr (tem, NULL_RTX, VOIDmode, EXPAND_WRITE); /* If the bitfield is volatile, we want to access it in the field's mode, not the computed mode. @@ -4892,17 +4857,6 @@ expand_assignment (tree to, tree from, bool nontemporal) get_alias_set (to), nontemporal); } - if (misalignp) - { - struct expand_operand ops[2]; - - create_fixed_operand (&ops[0], mem); - create_input_operand (&ops[1], to_rtx, mode); - /* The movmisalign<mode> pattern cannot fail, else the assignment - would silently be omitted. */ - expand_insn (icode, 2, ops); - } - if (result) preserve_temp_slots (result); pop_temp_slots (); |