OSDN Git Service

* gcc-interface/trans.c (gigi): Do not start statement group.
[pf3gnuchains/gcc-fork.git] / gcc / ada / gcc-interface / trans.c
index 678f5b1..c0c11bb 100644 (file)
@@ -2984,8 +2984,8 @@ call_to_gnu (Node_Id gnat_node, tree *gnu_result_type_p, tree gnu_target)
      passing mechanism must be used.  */
   if (TYPE_CI_CO_LIST (gnu_subprog_type))
     {
-      /* List of FIELD_DECLs associated with the PARM_DECLs of the copy-in/
-        copy-out parameters.  */
+      /* List of FIELD_DECLs associated with the PARM_DECLs of the copy
+        in copy out parameters.  */
       tree gnu_cico_list = TYPE_CI_CO_LIST (gnu_subprog_type);
       const int length = list_length (gnu_cico_list);
 
@@ -3025,8 +3025,7 @@ call_to_gnu (Node_Id gnat_node, tree *gnu_result_type_p, tree gnu_target)
              = length == 1
                ? gnu_call
                : build_component_ref (gnu_call, NULL_TREE,
-                                      TREE_PURPOSE (scalar_return_list),
-                                      false);
+                                      TREE_PURPOSE (gnu_cico_list), false);
 
            /* If the actual is a conversion, get the inner expression, which
               will be the real destination, and convert the result to the
@@ -3507,7 +3506,11 @@ Compilation_Unit_to_gnu (Node_Id gnat_node)
 
   /* Initialize the information structure for the function.  */
   allocate_struct_function (gnu_elab_proc_decl, false);
+  Sloc_to_locus (Sloc (gnat_unit_entity), &cfun->function_end_locus);
+  current_function_decl = NULL_TREE;
   set_cfun (NULL);
+  start_stmt_group ();
+  gnat_pushlevel ();
 
   current_function_decl = NULL_TREE;
 
@@ -5476,23 +5479,6 @@ gnat_to_gnu (Node_Id gnat_node)
   if (went_into_elab_proc)
     current_function_decl = NULL_TREE;
 
-  /* When not optimizing, turn boolean rvalues B into B != false tests
-     so that the code just below can put the location information of the
-     reference to B on the inequality operator for better debug info.  */
-  if (!optimize
-      && (kind == N_Identifier
-         || kind == N_Expanded_Name
-         || kind == N_Explicit_Dereference
-         || kind == N_Function_Call
-         || kind == N_Indexed_Component
-         || kind == N_Selected_Component)
-      && TREE_CODE (get_base_type (gnu_result_type)) == BOOLEAN_TYPE
-      && !lvalue_required_p (gnat_node, gnu_result_type, false, false, false))
-    gnu_result = build_binary_op (NE_EXPR, gnu_result_type,
-                                 convert (gnu_result_type, gnu_result),
-                                 convert (gnu_result_type,
-                                          boolean_false_node));
-
   /* Set the location information on the result if it is a real expression.
      References can be reused for multiple GNAT nodes and they would get
      the location information of their last use.  Note that we may have