This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/33709] [4.3 Regression] Type verification failure with new expression
- From: "rguenther at suse dot de" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 30 Oct 2007 13:24:03 -0000
- Subject: [Bug c++/33709] [4.3 Regression] Type verification failure with new expression
- References: <bug-33709-10053@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #4 from rguenther at suse dot de 2007-10-30 13:24 -------
Subject: Re: [4.3 Regression] Type verification failure with
new expression
On Tue, 30 Oct 2007, jakub at gcc dot gnu dot org wrote:
> ------- Comment #3 from jakub at gcc dot gnu dot org 2007-10-30 13:12 -------
> Testing a fix:
> --- gcc/fold-const.c.jj 2007-10-19 14:39:55.000000000 +0200
> +++ gcc/fold-const.c 2007-10-30 14:09:39.000000000 +0100
> @@ -9504,12 +9504,15 @@ fold_binary (enum tree_code code, tree t
> if (TREE_CODE (arg0) == COMPOUND_EXPR)
> return build2 (COMPOUND_EXPR, type, TREE_OPERAND (arg0, 0),
> fold_build2 (code, type,
> - TREE_OPERAND (arg0, 1), op1));
> + fold_convert (TREE_TYPE (op0),
> + TREE_OPERAND (arg0, 1)),
> + op1));
> if (TREE_CODE (arg1) == COMPOUND_EXPR
> && reorder_operands_p (arg0, TREE_OPERAND (arg1, 0)))
> return build2 (COMPOUND_EXPR, type, TREE_OPERAND (arg1, 0),
> - fold_build2 (code, type,
> - op0, TREE_OPERAND (arg1, 1)));
> + fold_build2 (code, type, op0,
> + fold_convert (TREE_TYPE (op1),
> + TREE_OPERAND (arg1, 1))));
>
> if (TREE_CODE (arg0) == COND_EXPR || COMPARISON_CLASS_P (arg0))
> {
Pre-approved if it works (it looks obvious). Thanks.
Richard.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33709