]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
tree-cfg.c (verify_types_in_gimple_assign): Dump mismatched types instead of operands.
authorRichard Guenther <rguenther@suse.de>
Sun, 31 Aug 2008 11:06:10 +0000 (11:06 +0000)
committerRichard Biener <rguenth@gcc.gnu.org>
Sun, 31 Aug 2008 11:06:10 +0000 (11:06 +0000)
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.

From-SVN: r139823

gcc/ChangeLog
gcc/tree-cfg.c

index 742e28abe1ff138fe36ff554ca438e98377a6aae..ca121a1c32dc5d221fe247d3b64f1bad4c1f4140 100644 (file)
@@ -1,3 +1,9 @@
+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.
+
 2008-08-30  Jan Hubicka  <jh@suse.cz>
 
        * fwprop.c (should_replace_address): Add speed attribute.
index 39a04e94a5f03678807595772a33bcb38286b049..c485027354cdbde3555213076b20a07baec399c4 100644 (file)
@@ -3549,8 +3549,25 @@ verify_types_in_gimple_assign (gimple stmt)
       if (!useless_type_conversion_p (lhs_type, rhs1_type))
        {
          error ("non-trivial conversion at assignment");
-         debug_generic_expr (lhs);
-         debug_generic_expr (rhs1);
+         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;
@@ -3561,8 +3578,8 @@ verify_types_in_gimple_assign (gimple stmt)
       if (!useless_type_conversion_p (lhs_type, rhs1_type))
        {
          error ("non-trivial conversion at assignment");
-         debug_generic_expr (lhs);
-         debug_generic_expr (rhs1);
+         debug_generic_expr (lhs_type);
+         debug_generic_expr (rhs1_type);
          return true;
        }
       return verify_types_in_gimple_reference (rhs1);