OSDN Git Service

2008-08-31 Richard Guenther <rguenther@suse.de>
authorrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>
Sun, 31 Aug 2008 11:06:10 +0000 (11:06 +0000)
committerrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>
Sun, 31 Aug 2008 11:06:10 +0000 (11:06 +0000)
* tree-cfg.c (verify_types_in_gimple_assign): Dump mismatched
types instead of operands.  Re-instantiate verifying of
binary expression operands.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@139823 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/tree-cfg.c

index 742e28a..ca121a1 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 39a04e9..c485027 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);