OSDN Git Service

2008-02-13 Andreas Krebbel <krebbel1@de.ibm.com>
[pf3gnuchains/gcc-fork.git] / gcc / gimplify.c
index 1075d65..bc576a0 100644 (file)
@@ -3096,6 +3096,10 @@ gimplify_init_ctor_eval (tree object, VEC(constructor_elt,gc) *elts,
 
       if (array_elt_type)
        {
+         /* Do not use bitsizetype for ARRAY_REF indices.  */
+         if (TYPE_DOMAIN (TREE_TYPE (object)))
+           purpose = fold_convert (TREE_TYPE (TYPE_DOMAIN (TREE_TYPE (object))),
+                                   purpose);
          cref = build4 (ARRAY_REF, array_elt_type, unshare_expr (object),
                         purpose, NULL_TREE, NULL_TREE);
        }
@@ -5330,6 +5334,10 @@ gimplify_omp_for (tree *expr_p, tree *pre_p)
   else
     var = decl;
 
+  /* If OMP_FOR is re-gimplified, ensure all variables in pre-body
+     are noticed.  */
+  gimplify_stmt (&OMP_FOR_PRE_BODY (for_stmt));
+
   ret |= gimplify_expr (&GENERIC_TREE_OPERAND (t, 1),
                        &OMP_FOR_PRE_BODY (for_stmt),
                        NULL, is_gimple_val, fb_rvalue);
@@ -6621,6 +6629,14 @@ force_gimple_operand (tree expr, tree *stmts, bool simple, tree var)
 
   pop_gimplify_context (NULL);
 
+  if (*stmts && gimple_in_ssa_p (cfun))
+    {
+      tree_stmt_iterator tsi;
+
+      for (tsi = tsi_start (*stmts); !tsi_end_p (tsi); tsi_next (&tsi))
+       mark_symbols_for_renaming (tsi_stmt (tsi));
+    }
+
   return expr;
 }
 
@@ -6640,14 +6656,6 @@ force_gimple_operand_bsi (block_stmt_iterator *bsi, tree expr,
   expr = force_gimple_operand (expr, &stmts, simple_p, var);
   if (stmts)
     {
-      if (gimple_in_ssa_p (cfun))
-       {
-         tree_stmt_iterator tsi;
-
-         for (tsi = tsi_start (stmts); !tsi_end_p (tsi); tsi_next (&tsi))
-           mark_symbols_for_renaming (tsi_stmt (tsi));
-       }
-
       if (before)
        bsi_insert_before (bsi, stmts, m);
       else