diff options
author | rth <rth@138bc75d-0d04-0410-961f-82ee72b054a4> | 2005-10-16 00:07:17 +0000 |
---|---|---|
committer | rth <rth@138bc75d-0d04-0410-961f-82ee72b054a4> | 2005-10-16 00:07:17 +0000 |
commit | c22de3f04dcff2c2b79d22541582a97f816be69b (patch) | |
tree | ce736adf1e7d1ab6bdbe217c3eed0c23288c5e0e /gcc/expr.c | |
parent | f8b3719138b59e3c9b3a085e47cb1ea50c9e7256 (diff) | |
download | gcc-c22de3f04dcff2c2b79d22541582a97f816be69b.tar.gz |
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.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@105449 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/expr.c')
-rw-r--r-- | gcc/expr.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/gcc/expr.c b/gcc/expr.c index 00419c8ba0c..9743c2a6082 100644 --- a/gcc/expr.c +++ b/gcc/expr.c @@ -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); |