[Ada] Minor tweak to default_pass_by_ref

Message ID 1532310.bcRbTanhrI@polaris
State New
Headers show
Series
  • [Ada] Minor tweak to default_pass_by_ref
Related show

Commit Message

Eric Botcazou Dec. 14, 2017, 5:17 p.m.
Tested on x86_64-suse-linux, applied on the mainline.


2017-12-14  Eric Botcazou  <ebotcazou@adacore.com>

	* gcc-interface/misc.c (default_pass_by_ref): Minor tweak.

-- 
Eric Botcazou

Patch

Index: gcc-interface/misc.c
===================================================================
--- gcc-interface/misc.c	(revision 331642)
+++ gcc-interface/misc.c	(revision 331643)
@@ -1144,18 +1144,18 @@  default_pass_by_ref (tree gnu_type)
      is an In Out parameter, but it's probably best to err on the side of
      passing more things by reference.  */
 
-  if (pass_by_reference (NULL, TYPE_MODE (gnu_type), gnu_type, true))
-    return true;
-
-  if (targetm.calls.return_in_memory (gnu_type, NULL_TREE))
-    return true;
-
   if (AGGREGATE_TYPE_P (gnu_type)
       && (!valid_constant_size_p (TYPE_SIZE_UNIT (gnu_type))
 	  || 0 < compare_tree_int (TYPE_SIZE_UNIT (gnu_type),
 				   TYPE_ALIGN (gnu_type))))
     return true;
 
+  if (pass_by_reference (NULL, TYPE_MODE (gnu_type), gnu_type, true))
+    return true;
+
+  if (targetm.calls.return_in_memory (gnu_type, NULL_TREE))
+    return true;
+
   return false;
 }