This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: C++ PATCH for c++/43031 (verify_gimple failure with stdcall pointer-to-member-functions)


On Tue, Feb 16, 2010 at 12:01:28PM +0100, Paolo Carlini wrote:
> Jason,
> 
> something is going wrong with either of your patches. Compare:
> 
>     http://gcc.gnu.org/ml/gcc-testresults/2010-02/msg01460.html
>     http://gcc.gnu.org/ml/gcc-testresults/2010-02/msg01464.html
> 
> Paolo.
> 
> PS: additionally, I gahter Richard actually applied his middle-end patch
> which exposes c++/43075 at -O2 (normal testing) too...

I believe the following patch should fix this.  While TREE_TYPE on
error_mark_node still silently succeeds, TYPE_STRUCTURAL_EQUALITY_P (or
useless_type_conversion_p) require the types to be actual types, not
error_mark_node.

2010-02-16  Jakub Jelinek  <jakub@redhat.com>

	* cp-gimplify.c (cp_gimplify_expr): Do nothing if either operand
	of INIT_EXPR or MODIFY_EXPR is errorneous.

--- gcc/cp/cp-gimplify.c.jj	2010-02-16 14:29:03.000000000 +0100
+++ gcc/cp/cp-gimplify.c	2010-02-16 15:01:18.000000000 +0100
@@ -1,6 +1,6 @@
 /* C++-specific tree lowering bits; see also c-gimplify.c and tree-gimple.c.
 
-   Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009
+   Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010
    Free Software Foundation, Inc.
    Contributed by Jason Merrill <jason@redhat.com>
 
@@ -560,6 +560,11 @@ cp_gimplify_expr (tree *expr_p, gimple_s
 	tree op0 = TREE_OPERAND (*expr_p, 0);
 	tree op1 = TREE_OPERAND (*expr_p, 1);
 
+	if (error_operand_p (op0) || error_operand_p (op1))
+	  {
+	    ret = GS_UNHANDLED;
+	    break;
+	  }
 	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)))


	Jakub


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]