aboutsummaryrefslogtreecommitdiff
path: root/gcc/fold-const.c
diff options
context:
space:
mode:
authorRichard Biener <rguenther@suse.de>2015-06-30 08:52:48 +0000
committerRichard Biener <rguenth@gcc.gnu.org>2015-06-30 08:52:48 +0000
commit582554e3bc1509b6ddc407004f97e3f756bcedf5 (patch)
treeb1ed01f79f0cbb1722548c3388771b77be0e8607 /gcc/fold-const.c
parent4f75d60893e092cffcbe422825ce4dc092d3fb9e (diff)
downloadgcc-582554e3bc1509b6ddc407004f97e3f756bcedf5.zip
gcc-582554e3bc1509b6ddc407004f97e3f756bcedf5.tar.gz
gcc-582554e3bc1509b6ddc407004f97e3f756bcedf5.tar.bz2
target-insns.def (canonicalize_funcptr_for_compare): Add.
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. From-SVN: r225163
Diffstat (limited to 'gcc/fold-const.c')
-rw-r--r--gcc/fold-const.c12
1 files changed, 3 insertions, 9 deletions
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;