https://gcc.gnu.org/g:3d4073371168cf5e9f58d18f617b117fb5839f81

commit r16-1960-g3d4073371168cf5e9f58d18f617b117fb5839f81
Author: Eric Botcazou <ebotca...@adacore.com>
Date:   Fri Jun 13 09:51:52 2025 +0200

    ada: Fix poor code generated for return of Out parameter with access type
    
    The record type of the return object is unnecessarily given BLKmode.
    
    gcc/ada/ChangeLog:
    
            * gcc-interface/decl.cc (type_contains_only_integral_data): Do not
            return false only because the type contains pointer data.

Diff:
---
 gcc/ada/gcc-interface/decl.cc | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/gcc/ada/gcc-interface/decl.cc b/gcc/ada/gcc-interface/decl.cc
index 27d2cea1f3d2..903ec844b968 100644
--- a/gcc/ada/gcc-interface/decl.cc
+++ b/gcc/ada/gcc-interface/decl.cc
@@ -6022,7 +6022,8 @@ gnat_to_gnu_profile_type (Entity_Id gnat_type)
   return gnu_type;
 }
 
-/* Return true if TYPE contains only integral data, recursively if need be.  */
+/* Return true if TYPE contains only integral data, recursively if need be.
+   (integral data is to be understood as not floating-point data here).  */
 
 static bool
 type_contains_only_integral_data (tree type)
@@ -6042,7 +6043,7 @@ type_contains_only_integral_data (tree type)
       return type_contains_only_integral_data (TREE_TYPE (type));
 
     default:
-      return INTEGRAL_TYPE_P (type);
+      return INTEGRAL_TYPE_P (type) || POINTER_TYPE_P (type);
     }
 
   gcc_unreachable ();

Reply via email to