From a89905fdd212bae10c6bc55662dec330e9a07b3e Mon Sep 17 00:00:00 2001 From: John David Anglin Date: Sun, 25 Oct 2015 15:18:48 +0000 Subject: [PATCH] re PR middle-end/68079 (hppa: pointers to method types need canonicalization before comparison) PR middle-end/68079 * dojump.c (do_compare_and_jump): Canonicalize both function and method types. From-SVN: r229299 --- gcc/ChangeLog | 6 ++++++ gcc/dojump.c | 10 ++++------ 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 02f71b941b0..0f6ddda570e 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2015-10-25 John David Anglin + + PR middle-end/68079 + * dojump.c (do_compare_and_jump): Canonicalize both function and + method types. + 2015-10-25 Uros Bizjak PR target/68084 diff --git a/gcc/dojump.c b/gcc/dojump.c index 6adc1a653cc..d767320a102 100644 --- a/gcc/dojump.c +++ b/gcc/dojump.c @@ -1207,12 +1207,10 @@ do_compare_and_jump (tree treeop0, tree treeop1, enum rtx_code signed_code, If one side isn't, we want a noncanonicalized comparison. See PR middle-end/17564. */ if (targetm.have_canonicalize_funcptr_for_compare () - && TREE_CODE (TREE_TYPE (treeop0)) == POINTER_TYPE - && TREE_CODE (TREE_TYPE (TREE_TYPE (treeop0))) - == FUNCTION_TYPE - && TREE_CODE (TREE_TYPE (treeop1)) == POINTER_TYPE - && TREE_CODE (TREE_TYPE (TREE_TYPE (treeop1))) - == FUNCTION_TYPE) + && POINTER_TYPE_P (TREE_TYPE (treeop0)) + && POINTER_TYPE_P (TREE_TYPE (treeop1)) + && FUNC_OR_METHOD_TYPE_P (TREE_TYPE (TREE_TYPE (treeop0))) + && FUNC_OR_METHOD_TYPE_P (TREE_TYPE (TREE_TYPE (treeop1)))) { rtx new_op0 = gen_reg_rtx (mode); rtx new_op1 = gen_reg_rtx (mode); -- 2.30.2