diff options
author | Richard Henderson <rth@redhat.com> | 2005-10-15 17:07:17 -0700 |
---|---|---|
committer | Richard Henderson <rth@gcc.gnu.org> | 2005-10-15 17:07:17 -0700 |
commit | 1e188d1e13003433b2efd794a0ae53749dc19d0c (patch) | |
tree | ce736adf1e7d1ab6bdbe217c3eed0c23288c5e0e /gcc/expr.c | |
parent | 48c410a254046d839bec7337831d6f21394fe12c (diff) | |
download | gcc-1e188d1e13003433b2efd794a0ae53749dc19d0c.zip gcc-1e188d1e13003433b2efd794a0ae53749dc19d0c.tar.gz gcc-1e188d1e13003433b2efd794a0ae53749dc19d0c.tar.bz2 |
re PR middle-end/23714 (ICE in expand_assignment)
PR 23714
* builtins.c (expand_builtin_trap): Export.
* expr.h (expand_builtin_trap): Declare.
* expr.c (expand_assignment): Emit a trap for integral offsets
from registers that weren't reduced to bitpos.
* tree-cfg.c (mark_array_ref_addressable_1): Remove.
(mark_array_ref_addressable): Remove.
* tree-flow.h (mark_array_ref_addressable): Remove.
* tree-optimize.c (execute_cleanup_cfg_post_optimizing): Don't call it.
From-SVN: r105449
Diffstat (limited to 'gcc/expr.c')
-rw-r--r-- | gcc/expr.c | 12 |
1 files changed, 10 insertions, 2 deletions
@@ -3924,10 +3924,18 @@ expand_assignment (tree to, tree from) if (offset != 0) { - rtx offset_rtx = expand_expr (offset, NULL_RTX, VOIDmode, EXPAND_SUM); + rtx offset_rtx; - gcc_assert (MEM_P (to_rtx)); + if (!MEM_P (to_rtx)) + { + /* We can get constant negative offsets into arrays with broken + user code. Translate this to a trap instead of ICEing. */ + gcc_assert (TREE_CODE (offset) == INTEGER_CST); + expand_builtin_trap (); + to_rtx = gen_rtx_MEM (BLKmode, const0_rtx); + } + offset_rtx = expand_expr (offset, NULL_RTX, VOIDmode, EXPAND_SUM); #ifdef POINTERS_EXTEND_UNSIGNED if (GET_MODE (offset_rtx) != Pmode) offset_rtx = convert_to_mode (Pmode, offset_rtx, 0); |