OSDN Git Service

2010-04-26 Richard Guenther <rguenther@suse.de>
[pf3gnuchains/gcc-fork.git] / gcc / c-gimplify.c
index cf06974..5ee9634 100644 (file)
@@ -29,7 +29,6 @@ along with GCC; see the file COPYING3.  If not see
 #include "coretypes.h"
 #include "tm.h"
 #include "tree.h"
-#include "varray.h"
 #include "c-tree.h"
 #include "c-common.h"
 #include "gimple.h"
@@ -103,14 +102,7 @@ c_genericize (tree fndecl)
       dump_end (TDI_original, dump_orig);
     }
 
-  /* Go ahead and gimplify for now.  */
-  gimplify_function_tree (fndecl);
-
-  dump_function (TDI_generic, fndecl);
-
-  /* Genericize all nested functions now.  We do things in this order so
-     that items like VLA sizes are expanded properly in the context of
-     the correct function.  */
+  /* Dump all nested functions now.  */
   cgn = cgraph_node (fndecl);
   for (cgn = cgn->nested; cgn ; cgn = cgn->next_nested)
     c_genericize (cgn->decl);
@@ -140,7 +132,7 @@ add_block_to_enclosing (tree block)
      genericized.  */
 
 tree
-c_build_bind_expr (tree block, tree body)
+c_build_bind_expr (location_t loc, tree block, tree body)
 {
   tree decls, bind;
 
@@ -162,11 +154,12 @@ c_build_bind_expr (tree block, tree body)
     }
 
   if (!body)
-    body = build_empty_stmt ();
+    body = build_empty_stmt (loc);
   if (decls || block)
     {
       bind = build3 (BIND_EXPR, void_type_node, decls, body, block);
       TREE_SIDE_EFFECTS (bind) = 1;
+      SET_EXPR_LOCATION (bind, loc);
     }
   else
     bind = body;
@@ -196,19 +189,5 @@ c_gimplify_expr (tree *expr_p, gimple_seq *pre_p ATTRIBUTE_UNUSED,
       && !warn_init_self)
     TREE_NO_WARNING (DECL_EXPR_DECL (*expr_p)) = 1;
 
-  /* The C frontend is the only one producing &ARRAY with pointer-to-element
-     type.  This is invalid in gimple, so produce a properly typed
-     ADDR_EXPR instead and wrap a conversion around it.  */
-  if (code == ADDR_EXPR
-      && TREE_CODE (TREE_TYPE (TREE_OPERAND (*expr_p, 0))) == ARRAY_TYPE
-      && TREE_CODE (TREE_TYPE (TREE_TYPE (*expr_p))) != ARRAY_TYPE)
-    {
-      tree type = TREE_TYPE (*expr_p);
-      TREE_TYPE (*expr_p)
-       = build_pointer_type (TREE_TYPE (TREE_OPERAND (*expr_p, 0)));
-      *expr_p = build1 (NOP_EXPR, type, *expr_p);
-      return GS_OK;
-    }
-
   return GS_UNHANDLED;
 }