OSDN Git Service

* gcc-interfaces/decl.c (elaborate_expression_1): Use the variable for
authorebotcazou <ebotcazou@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 2 Oct 2012 10:35:03 +0000 (10:35 +0000)
committerebotcazou <ebotcazou@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 2 Oct 2012 10:35:03 +0000 (10:35 +0000)
bounds of loop iteraration scheme only for locally defined subtypes.

* gcc-interface/trans.c (build_return_expr): Apply the NRV optimization
only for BLKmode.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/gcc-4_7-branch@191972 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ada/ChangeLog
gcc/ada/gcc-interface/decl.c
gcc/ada/gcc-interface/trans.c

index 9a48ee5..4fac921 100644 (file)
@@ -1,3 +1,11 @@
+2012-10-02  Eric Botcazou  <ebotcazou@adacore.com>
+
+       * gcc-interfaces/decl.c (elaborate_expression_1): Use the variable for
+       bounds of loop iteraration scheme only for locally defined subtypes.
+
+       * gcc-interface/trans.c (build_return_expr): Apply the NRV optimization
+       only for BLKmode.
+
 2012-09-20  Release Manager
 
        * GCC 4.7.2 released.
index 33cad2c..72bbd80 100644 (file)
@@ -6346,6 +6346,7 @@ elaborate_expression_1 (tree gnu_expr, Entity_Id gnat_entity, tree gnu_name,
   use_variable = expr_variable_p
                 && (expr_global_p
                     || (!optimize
+                        && definition
                         && Is_Itype (gnat_entity)
                         && Nkind (Associated_Node_For_Itype (gnat_entity))
                            == N_Loop_Parameter_Specification));
index 61648c5..63363f5 100644 (file)
@@ -3123,6 +3123,7 @@ build_return_expr (tree ret_obj, tree ret_val)
       if (optimize
          && AGGREGATE_TYPE_P (operation_type)
          && !TYPE_IS_FAT_POINTER_P (operation_type)
+         && TYPE_MODE (operation_type) == BLKmode
          && aggregate_value_p (operation_type, current_function_decl))
        {
          /* Recognize the temporary created for a return value with variable