Commit b713a445 by Andrew Pinski Committed by Andrew Pinski

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
parent 62d1db17
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-24 Alan Modra <amodra@bigpond.net.au> 2004-06-24 Alan Modra <amodra@bigpond.net.au>
* calls.c (expand_call): Call INIT_CUMULATIVE_ARGS earlier, and * calls.c (expand_call): Call INIT_CUMULATIVE_ARGS earlier, and
......
...@@ -1907,7 +1907,9 @@ fold_convert (tree type, tree arg) ...@@ -1907,7 +1907,9 @@ fold_convert (tree type, tree arg)
|| TREE_CODE (orig) == ERROR_MARK) || TREE_CODE (orig) == ERROR_MARK)
return error_mark_node; 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)); return fold (build1 (NOP_EXPR, type, arg));
if (INTEGRAL_TYPE_P (type) || POINTER_TYPE_P (type) if (INTEGRAL_TYPE_P (type) || POINTER_TYPE_P (type)
......
2004-06-23 Andrew Pinski <apinski@apple.com> 2004-06-23 Andrew Pinski <apinski@apple.com>
PR middle-end/15988
* g++.dg/opt/ptrmem4.C: New test.
* gcc.dg/c90-array-quals-2.c: New test. * gcc.dg/c90-array-quals-2.c: New test.
2006-06-23 Nitin Yewale <NitinY@KPITCummins.com> 2006-06-23 Nitin Yewale <NitinY@KPITCummins.com>
......
// { dg-do run }
// { dg-options "-O3" }
struct X { void foo (); };
template <typename>
inline void spawn (void (X::*fun_ptr)()) {}
void bar () {
void (X::*const comp)() = &X::foo;
spawn<int> (comp);
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment