This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[PATCH] Re-instantiate type checking for binary expressions
- From: Richard Guenther <rguenther at suse dot de>
- To: gcc-patches at gcc dot gnu dot org
- Date: Sun, 31 Aug 2008 13:05:07 +0200 (CEST)
- Subject: [PATCH] Re-instantiate type checking for binary expressions
This was also lost during the tuples conversion.
Bootstrapped and tested on x86_64-unknown-linux-gnu, applied to the trunk.
Richard.
2008-08-31 Richard Guenther <rguenther@suse.de>
* tree-cfg.c (verify_types_in_gimple_assign): Dump mismatched
types instead of operands. Re-instantiate verifying of
binary expression operands.
Index: gcc/tree-cfg.c
===================================================================
*** gcc/tree-cfg.c.orig 2008-08-31 12:53:09.000000000 +0200
--- gcc/tree-cfg.c 2008-08-31 12:59:15.000000000 +0200
*************** verify_types_in_gimple_assign (gimple st
*** 3549,3556 ****
if (!useless_type_conversion_p (lhs_type, rhs1_type))
{
error ("non-trivial conversion at assignment");
! debug_generic_expr (lhs);
! debug_generic_expr (rhs1);
return true;
}
break;
--- 3549,3573 ----
if (!useless_type_conversion_p (lhs_type, rhs1_type))
{
error ("non-trivial conversion at assignment");
! debug_generic_expr (lhs_type);
! debug_generic_expr (rhs1_type);
! return true;
! }
! break;
!
! case tcc_binary:
! if (!is_gimple_val (rhs1) || !is_gimple_val (rhs2))
! {
! error ("invalid operands in binary expression");
! return true;
! }
! if (!useless_type_conversion_p (lhs_type, rhs1_type)
! || !useless_type_conversion_p (lhs_type, rhs2_type))
! {
! error ("type mismatch in binary expression");
! debug_generic_stmt (lhs_type);
! debug_generic_stmt (rhs1_type);
! debug_generic_stmt (rhs2_type);
return true;
}
break;
*************** verify_types_in_gimple_assign (gimple st
*** 3561,3568 ****
if (!useless_type_conversion_p (lhs_type, rhs1_type))
{
error ("non-trivial conversion at assignment");
! debug_generic_expr (lhs);
! debug_generic_expr (rhs1);
return true;
}
return verify_types_in_gimple_reference (rhs1);
--- 3578,3585 ----
if (!useless_type_conversion_p (lhs_type, rhs1_type))
{
error ("non-trivial conversion at assignment");
! debug_generic_expr (lhs_type);
! debug_generic_expr (rhs1_type);
return true;
}
return verify_types_in_gimple_reference (rhs1);