From 582554e3bc1509b6ddc407004f97e3f756bcedf5 Mon Sep 17 00:00:00 2001 From: Richard Biener Date: Tue, 30 Jun 2015 08:52:48 +0000 Subject: target-insns.def (canonicalize_funcptr_for_compare): Add. 2015-06-30 Richard Biener * 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. From-SVN: r225163 --- gcc/fold-const.c | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) (limited to 'gcc/fold-const.c') diff --git a/gcc/fold-const.c b/gcc/fold-const.c index a447452..5cdb6d1 100644 --- a/gcc/fold-const.c +++ b/gcc/fold-const.c @@ -4488,14 +4488,12 @@ build_range_check (location_t loc, tree type, tree exp, int in_p, { tree etype = TREE_TYPE (exp), value; -#ifdef HAVE_canonicalize_funcptr_for_compare /* Disable this optimization for function pointer expressions on targets that require function pointer canonicalization. */ - if (HAVE_canonicalize_funcptr_for_compare + if (targetm.have_canonicalize_funcptr_for_compare () && TREE_CODE (etype) == POINTER_TYPE && TREE_CODE (TREE_TYPE (etype)) == FUNCTION_TYPE) return NULL_TREE; -#endif if (! in_p) { @@ -6964,14 +6962,12 @@ fold_widened_comparison (location_t loc, enum tree_code code, return NULL_TREE; shorter_type = TREE_TYPE (arg0_unw); -#ifdef HAVE_canonicalize_funcptr_for_compare /* Disable this optimization if we're casting a function pointer type on targets that require function pointer canonicalization. */ - if (HAVE_canonicalize_funcptr_for_compare + if (targetm.have_canonicalize_funcptr_for_compare () && TREE_CODE (shorter_type) == POINTER_TYPE && TREE_CODE (TREE_TYPE (shorter_type)) == FUNCTION_TYPE) return NULL_TREE; -#endif if (TYPE_PRECISION (TREE_TYPE (arg0)) <= TYPE_PRECISION (shorter_type)) return NULL_TREE; @@ -7059,14 +7055,12 @@ fold_sign_changed_comparison (location_t loc, enum tree_code code, tree type, arg0_inner = TREE_OPERAND (arg0, 0); inner_type = TREE_TYPE (arg0_inner); -#ifdef HAVE_canonicalize_funcptr_for_compare /* Disable this optimization if we're casting a function pointer type on targets that require function pointer canonicalization. */ - if (HAVE_canonicalize_funcptr_for_compare + if (targetm.have_canonicalize_funcptr_for_compare () && TREE_CODE (inner_type) == POINTER_TYPE && TREE_CODE (TREE_TYPE (inner_type)) == FUNCTION_TYPE) return NULL_TREE; -#endif if (TYPE_PRECISION (inner_type) != TYPE_PRECISION (outer_type)) return NULL_TREE; -- cgit v1.1