diff options
author | Richard Guenther <rguenther@suse.de> | 2011-01-18 15:50:55 +0000 |
---|---|---|
committer | Richard Biener <rguenth@gcc.gnu.org> | 2011-01-18 15:50:55 +0000 |
commit | 4994da65e5f158243b6322fb6d3a47fa12b2962e (patch) | |
tree | d38fdc7f5a515bad12f63a6dce21d0eba6f42eaa /gcc/emit-rtl.c | |
parent | 1eb458d14097fc0fb4d8a386d8b9fba292547360 (diff) | |
download | gcc-4994da65e5f158243b6322fb6d3a47fa12b2962e.zip gcc-4994da65e5f158243b6322fb6d3a47fa12b2962e.tar.gz gcc-4994da65e5f158243b6322fb6d3a47fa12b2962e.tar.bz2 |
re PR rtl-optimization/47216 (gcc.dg/torture/pr43360.c FAILs with -O -fPIC -fgcse -fgcse-sm -fnon-call-exceptions -fno-tree-dse)
2011-01-18 Richard Guenther <rguenther@suse.de>
PR rtl-optimization/47216
* emit-rtl.c: Include tree-flow.h.
(set_mem_attributes_minus_bitpos): Use tree_could_trap_p instead
of replicating it with different semantics.
* Makefile.in (emit-rtl.o): Adjust.
From-SVN: r168951
Diffstat (limited to 'gcc/emit-rtl.c')
-rw-r--r-- | gcc/emit-rtl.c | 32 |
1 files changed, 5 insertions, 27 deletions
diff --git a/gcc/emit-rtl.c b/gcc/emit-rtl.c index 0839d0b..4ff5d4e 100644 --- a/gcc/emit-rtl.c +++ b/gcc/emit-rtl.c @@ -59,6 +59,7 @@ along with GCC; see the file COPYING3. If not see #include "df.h" #include "params.h" #include "target.h" +#include "tree-flow.h" struct target_rtl default_target_rtl; #if SWITCHABLE_TARGET @@ -1669,33 +1670,10 @@ set_mem_attributes_minus_bitpos (rtx ref, tree t, int objectp, || TREE_CODE (t) == SAVE_EXPR) t = TREE_OPERAND (t, 0); - /* We may look through structure-like accesses for the purposes of - examining TREE_THIS_NOTRAP, but not array-like accesses. */ - base = t; - while (TREE_CODE (base) == COMPONENT_REF - || TREE_CODE (base) == REALPART_EXPR - || TREE_CODE (base) == IMAGPART_EXPR - || TREE_CODE (base) == BIT_FIELD_REF) - base = TREE_OPERAND (base, 0); - - if (TREE_CODE (base) == MEM_REF - && TREE_CODE (TREE_OPERAND (base, 0)) == ADDR_EXPR) - base = TREE_OPERAND (TREE_OPERAND (base, 0), 0); - if (DECL_P (base)) - { - if (CODE_CONTAINS_STRUCT (TREE_CODE (base), TS_DECL_WITH_VIS)) - MEM_NOTRAP_P (ref) = !DECL_WEAK (base); - else - MEM_NOTRAP_P (ref) = 1; - } - else if (TREE_CODE (base) == INDIRECT_REF - || TREE_CODE (base) == MEM_REF - || TREE_CODE (base) == TARGET_MEM_REF - || TREE_CODE (base) == ARRAY_REF - || TREE_CODE (base) == ARRAY_RANGE_REF) - MEM_NOTRAP_P (ref) = TREE_THIS_NOTRAP (base); - - base = get_base_address (base); + /* Note whether this expression can trap. */ + MEM_NOTRAP_P (ref) = !tree_could_trap_p (t); + + base = get_base_address (t); if (base && DECL_P (base) && TREE_READONLY (base) && (TREE_STATIC (base) || DECL_EXTERNAL (base)) |