aboutsummaryrefslogtreecommitdiff
path: root/gcc/fold-const.c
diff options
context:
space:
mode:
authorJohn David Anglin <danglin@gcc.gnu.org>2018-09-14 23:26:12 +0000
committerJohn David Anglin <danglin@gcc.gnu.org>2018-09-14 23:26:12 +0000
commitf3743e2e32432a1d961c81097db3f755fd2dae76 (patch)
tree408d2c467782ee84c4590e65b055f6b0cb4fbc1a /gcc/fold-const.c
parent07f879058339c496273c9960562c3fdad317001a (diff)
downloadgcc-f3743e2e32432a1d961c81097db3f755fd2dae76.zip
gcc-f3743e2e32432a1d961c81097db3f755fd2dae76.tar.gz
gcc-f3743e2e32432a1d961c81097db3f755fd2dae76.tar.bz2
re PR middle-end/87188 (Function pointer canonicalization optimized away)
PR middle-end/87188 * dojump.c (do_compare_and_jump): Canonicalize function pointers when one operand is a function pointer. Use POINTER_TYPE_P and FUNC_OR_METHOD_TYPE_P. * expr.c (do_store_flag): Use POINTER_TYPE_P and FUNC_OR_METHOD_TYPE_P. * fold-const.c (build_range_check): Likewise. * match.pd (simple_comparison): Likewise. From-SVN: r264336
Diffstat (limited to 'gcc/fold-const.c')
-rw-r--r--gcc/fold-const.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/gcc/fold-const.c b/gcc/fold-const.c
index 6b4b6a4..3a6d1b1 100644
--- a/gcc/fold-const.c
+++ b/gcc/fold-const.c
@@ -4956,8 +4956,8 @@ build_range_check (location_t loc, tree type, tree exp, int in_p,
/* Disable this optimization for function pointer expressions
on targets that require function pointer canonicalization. */
if (targetm.have_canonicalize_funcptr_for_compare ()
- && TREE_CODE (etype) == POINTER_TYPE
- && TREE_CODE (TREE_TYPE (etype)) == FUNCTION_TYPE)
+ && POINTER_TYPE_P (etype)
+ && FUNC_OR_METHOD_TYPE_P (TREE_TYPE (etype)))
return NULL_TREE;
if (! in_p)