Commit 1e2ddf80 by Jason Merrill Committed by Jason Merrill

re PR c++/43031 (internal compiler error: verify_gimple failed after non-trivial…

re PR c++/43031 (internal compiler error: verify_gimple failed after non-trivial conversion error when crosscompiling Firefox)

	PR c++/43031
	* cp-gimplify.c (cp_gimplify_expr) [MODIFY_EXPR]: Use
	VIEW_CONVERT_EXPR for conversions between structural equality types
	that the back end can't tell are the same.

From-SVN: r156793
parent 38e40fcd
2010-02-16 Jason Merrill <jason@redhat.com>
PR c++/43031
* cp-gimplify.c (cp_gimplify_expr) [MODIFY_EXPR]: Use
VIEW_CONVERT_EXPR for conversions between structural equality types
that the back end can't tell are the same.
PR c++/43036
* tree.c (build_cplus_array_type): Set TYPE_MAIN_VARIANT to strip
cv-quals from element here.
......
......@@ -552,6 +552,20 @@ cp_gimplify_expr (tree *expr_p, gimple_seq *pre_p, gimple_seq *post_p)
25979. */
case INIT_EXPR:
cp_gimplify_init_expr (expr_p, pre_p, post_p);
/* Fall through. */
case MODIFY_EXPR:
{
/* If the back end isn't clever enough to know that the lhs and rhs
types are the same, add an explicit conversion. */
tree op0 = TREE_OPERAND (*expr_p, 0);
tree op1 = TREE_OPERAND (*expr_p, 1);
if ((TYPE_STRUCTURAL_EQUALITY_P (TREE_TYPE (op0))
|| TYPE_STRUCTURAL_EQUALITY_P (TREE_TYPE (op1)))
&& !useless_type_conversion_p (TREE_TYPE (op1), TREE_TYPE (op0)))
TREE_OPERAND (*expr_p, 1) = build1 (VIEW_CONVERT_EXPR,
TREE_TYPE (op0), op1);
}
ret = GS_OK;
break;
......
2010-02-16 Jason Merrill <jason@redhat.com>
PR c++/43031
* g++.dg/ext/attrib36.C: New.
PR c++/43036
* g++.dg/other/array6.C: New.
......
// PR c++/43031
// { dg-do compile { target i?86-*-* x86_64-*-* } }
class T;
class L { };
class P : public L
{
typedef void (__attribute__((__stdcall__)) T::*F) (L*);
void f(bool aAdd);
};
class T
{
public:
virtual void __attribute__((__stdcall__)) A(L *listener) = 0;
virtual void __attribute__((__stdcall__)) R(L *listener) = 0;
};
void P::f(bool aAdd)
{
F addRemoveEventListener = (aAdd ? &T::A : &T::R);
}
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