diff options
author | rguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4> | 2015-06-30 08:52:48 +0000 |
---|---|---|
committer | rguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4> | 2015-06-30 08:52:48 +0000 |
commit | a84cae9031653443ed9861ed5af4bd4ffb773110 (patch) | |
tree | b1ed01f79f0cbb1722548c3388771b77be0e8607 /gcc/dojump.c | |
parent | 5d4f3ed8fef038c3a16e962831119564c8094cb0 (diff) | |
download | gcc-a84cae9031653443ed9861ed5af4bd4ffb773110.tar.gz |
2015-06-30 Richard Biener <rguenther@suse.de>
* target-insns.def (canonicalize_funcptr_for_compare): Add.
* fold-const.c (build_range_check): Replace uses of
HAVE_canonicalize_funcptr_for_compare.
(fold_widened_comparison): Likewise.
(fold_sign_changed_comparison): Likewise.
* dojump.c: Include "target.h".
(do_compare_and_jump): Replace uses of
HAVE_canonicalize_funcptr_for_compare and
gen_canonicalize_funcptr_for_compare.
* expr.c (do_store_flag): Likewise.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@225163 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/dojump.c')
-rw-r--r-- | gcc/dojump.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/gcc/dojump.c b/gcc/dojump.c index b062a569cf5..15b1ebf93cb 100644 --- a/gcc/dojump.c +++ b/gcc/dojump.c @@ -47,6 +47,7 @@ along with GCC; see the file COPYING3. If not see #include "predict.h" #include "basic-block.h" #include "tm_p.h" +#include "target.h" static bool prefer_and_bit_test (machine_mode, int); static void do_jump_by_parts_greater (tree, tree, int, @@ -1204,13 +1205,12 @@ do_compare_and_jump (tree treeop0, tree treeop1, enum rtx_code signed_code, unsignedp = TYPE_UNSIGNED (type); code = unsignedp ? unsigned_code : signed_code; -#ifdef HAVE_canonicalize_funcptr_for_compare /* If function pointers need to be "canonicalized" before they can be reliably compared, then canonicalize them. Only do this if *both* sides of the comparison are function pointers. If one side isn't, we want a noncanonicalized comparison. See PR middle-end/17564. */ - if (HAVE_canonicalize_funcptr_for_compare + if (targetm.have_canonicalize_funcptr_for_compare () && TREE_CODE (TREE_TYPE (treeop0)) == POINTER_TYPE && TREE_CODE (TREE_TYPE (TREE_TYPE (treeop0))) == FUNCTION_TYPE @@ -1221,13 +1221,12 @@ do_compare_and_jump (tree treeop0, tree treeop1, enum rtx_code signed_code, rtx new_op0 = gen_reg_rtx (mode); rtx new_op1 = gen_reg_rtx (mode); - emit_insn (gen_canonicalize_funcptr_for_compare (new_op0, op0)); + emit_insn (targetm.gen_canonicalize_funcptr_for_compare (new_op0, op0)); op0 = new_op0; - emit_insn (gen_canonicalize_funcptr_for_compare (new_op1, op1)); + emit_insn (targetm.gen_canonicalize_funcptr_for_compare (new_op1, op1)); op1 = new_op1; } -#endif do_compare_rtx_and_jump (op0, op1, code, unsignedp, mode, ((mode == BLKmode) |