aboutsummaryrefslogtreecommitdiff
path: root/gcc/fold-const.c
diff options
context:
space:
mode:
authorAndrew Pinski <apinski@apple.com>2004-06-24 06:51:56 +0000
committerAndrew Pinski <pinskia@gcc.gnu.org>2004-06-23 23:51:56 -0700
commitb713a445f2bfa00419e7efdb5ffc0cf89e335227 (patch)
tree8b542cb717be7d0a6115fd0fa9904df608c4535f /gcc/fold-const.c
parent62d1db179e700aeb45e805aa81de54036745f93e (diff)
downloadgcc-b713a445f2bfa00419e7efdb5ffc0cf89e335227.zip
gcc-b713a445f2bfa00419e7efdb5ffc0cf89e335227.tar.gz
gcc-b713a445f2bfa00419e7efdb5ffc0cf89e335227.tar.bz2
re PR middle-end/15988 (ICE in fold_convert with pointer-to-member-function)
2004-06-23 Andrew Pinski <apinski@apple.com> PR middle-end/15988 * fold-const.c (fold_convert): Types which are compatible can be converted with only a NOP_EXPR. 2004-06-23 Andrew Pinski <apinski@apple.com> PR middle-end/15988 * g++.dg/opt/ptrmem4.C: New test. From-SVN: r83585
Diffstat (limited to 'gcc/fold-const.c')
-rw-r--r--gcc/fold-const.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/gcc/fold-const.c b/gcc/fold-const.c
index 0dd5973..6ef7b1a 100644
--- a/gcc/fold-const.c
+++ b/gcc/fold-const.c
@@ -1907,7 +1907,9 @@ fold_convert (tree type, tree arg)
|| TREE_CODE (orig) == ERROR_MARK)
return error_mark_node;
- if (TYPE_MAIN_VARIANT (type) == TYPE_MAIN_VARIANT (orig))
+ if (TYPE_MAIN_VARIANT (type) == TYPE_MAIN_VARIANT (orig)
+ || lang_hooks.types_compatible_p (TYPE_MAIN_VARIANT (type),
+ TYPE_MAIN_VARIANT (orig)))
return fold (build1 (NOP_EXPR, type, arg));
if (INTEGRAL_TYPE_P (type) || POINTER_TYPE_P (type)