OSDN Git Service

Daily bump.
[pf3gnuchains/gcc-fork.git] / gcc / fortran / convert.c
index f69ea23..96874fa 100644 (file)
@@ -1,5 +1,5 @@
 /* Language-level data type conversion for GNU C.
-   Copyright (C) 1987, 1988, 1991, 1998, 2002, 2007, 2008
+   Copyright (C) 1987, 1988, 1991, 1998, 2002, 2007, 2008, 2010
    Free Software Foundation, Inc.
 
 This file is part of GCC.
@@ -40,7 +40,7 @@ along with GCC; see the file COPYING3.  If not see
 #include "tree.h"
 #include "flags.h"
 #include "convert.h"
-#include "toplev.h"    /* For error.  */
+#include "diagnostic-core.h"   /* For error.  */
 #include "gfortran.h"
 #include "trans.h"
 
@@ -80,7 +80,7 @@ convert (tree type, tree expr)
     return expr;
 
   if (TYPE_MAIN_VARIANT (type) == TYPE_MAIN_VARIANT (TREE_TYPE (expr)))
-    return fold_build1 (NOP_EXPR, type, expr);
+    return fold_build1_loc (input_location, NOP_EXPR, type, expr);
   if (TREE_CODE (TREE_TYPE (expr)) == ERROR_MARK)
     return error_mark_node;
   if (TREE_CODE (TREE_TYPE (expr)) == VOID_TYPE)
@@ -89,7 +89,7 @@ convert (tree type, tree expr)
       return error_mark_node;
     }
   if (code == VOID_TYPE)
-    return fold_build1 (CONVERT_EXPR, type, e);
+    return fold_build1_loc (input_location, CONVERT_EXPR, type, e);
 #if 0
   /* This is incorrect.  A truncation can't be stripped this way.
      Extensions will be stripped by the use of get_unwidened.  */
@@ -105,9 +105,10 @@ convert (tree type, tree expr)
       /* If we have a NOP_EXPR, we must fold it here to avoid
         infinite recursion between fold () and convert ().  */
       if (TREE_CODE (e) == NOP_EXPR)
-       return fold_build1 (NOP_EXPR, type, TREE_OPERAND (e, 0));
+       return fold_build1_loc (input_location, NOP_EXPR, type,
+                               TREE_OPERAND (e, 0));
       else
-       return fold_build1 (NOP_EXPR, type, e);
+       return fold_build1_loc (input_location, NOP_EXPR, type, e);
     }
   if (code == POINTER_TYPE || code == REFERENCE_TYPE)
     return fold (convert_to_pointer (type, e));