Add is_Conv().
[libfirm] / ir / ir / irvrfy.c
index 0ad233e..dd35653 100644 (file)
@@ -1,15 +1,28 @@
 /*
- * Project:     libFIRM
- * File name:   ir/ir/irvrfy.c
- * Purpose:     Check irnodes for correctness.
- * Author:      Christian Schaefer
- * Modified by: Goetz Lindenmaier. Till Riedel. Michael Beck.
- * Created:
- * CVS-ID:      $Id$
- * Copyright:   (c) 1998-2003 Universität Karlsruhe
- * Licence:     This file protected by GPL -  GNU GENERAL PUBLIC LICENSE.
+ * Copyright (C) 1995-2007 University of Karlsruhe.  All right reserved.
+ *
+ * This file is part of libFirm.
+ *
+ * This file may be distributed and/or modified under the terms of the
+ * GNU General Public License version 2 as published by the Free Software
+ * Foundation and appearing in the file LICENSE.GPL included in the
+ * packaging of this file.
+ *
+ * Licensees holding valid libFirm Professional Edition licenses may use
+ * this file in accordance with the libFirm Commercial License.
+ * Agreement provided with the Software.
+ *
+ * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+ * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE.
  */
 
+/**
+ * @file
+ * @brief    Check irnodes for correctness.
+ * @author   Christian Schaefer, Goetz Lindenmaier, Till Riedel, Michael Beck
+ * @version  $Id$
+ */
 #ifdef HAVE_CONFIG_H
 # include "config.h"
 #endif
@@ -1643,12 +1656,16 @@ static int verify_node_CopyB(ir_node *n, ir_graph *irg) {
   ir_type *t = get_CopyB_type(n);
 
   /* CopyB: BB x M x ref x ref --> M x X */
-  ASSERT_AND_RET(
-    mymode == mode_T &&
-    op1mode == mode_M &&
-    mode_is_reference(op2mode) &&
-    mode_is_reference(op3mode),
-    "CopyB node", 0 );  /* operand M x ref x ref */
+  ASSERT_AND_RET(mymode == mode_T && op1mode == mode_M, "CopyB node", 0);
+  if(get_irg_phase_state(irg) != phase_backend) {
+         ASSERT_AND_RET(mode_is_reference(op2mode) && mode_is_reference(op3mode),
+                     "CopyB node", 0 );
+  } else {
+      ASSERT_AND_RET(mode_is_reference(op2mode) ||
+                         (mode_is_int(op2mode) && get_mode_size_bits(op2mode) == get_mode_size_bits(mode_P)), "Load node", 0 );
+      ASSERT_AND_RET(mode_is_reference(op3mode) ||
+                         (mode_is_int(op3mode) && get_mode_size_bits(op3mode) == get_mode_size_bits(mode_P)), "Load node", 0 );
+  }
 
   ASSERT_AND_RET(
     is_compound_type(t),