This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[PATCH] Re-enable gimple type-checking for assignments
- From: Richard Guenther <rguenther at suse dot de>
- To: gcc-patches at gcc dot gnu dot org
- Date: Mon, 18 Aug 2008 16:19:15 +0200 (CEST)
- Subject: [PATCH] Re-enable gimple type-checking for assignments
which somehow got lost during tuplification. Now we correctly complain
about PR37146.
Bootstrapped and tested on x86_64-unknown-linux-gnu (so it can't be too
bad ;)), applied to trunk.
Richard.
2008-08-18 Richard Guenther <rguenther@suse.de>
* tree-cfg.c (verify_types_in_gimple_assign): Verify copies
and loads have the correct types.
Index: gcc/tree-cfg.c
===================================================================
*** gcc/tree-cfg.c (revision 139189)
--- gcc/tree-cfg.c (working copy)
*************** verify_types_in_gimple_assign (gimple st
*** 3544,3549 ****
--- 3544,3550 ----
/* Generic handling via classes. */
switch (TREE_CODE_CLASS (rhs_code))
{
+ case tcc_exceptional: /* for SSA_NAME */
case tcc_unary:
if (!useless_type_conversion_p (lhs_type, rhs1_type))
{
*************** verify_types_in_gimple_assign (gimple st
*** 3555,3560 ****
--- 3556,3570 ----
break;
case tcc_reference:
+ /* All tcc_reference trees are GIMPLE_SINGLE_RHS. Verify that
+ no implicit type change happens here. */
+ 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);
case tcc_comparison: