]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
ada: Fix poor code generated for return of Out parameter with access type
authorEric Botcazou <ebotcazou@adacore.com>
Fri, 13 Jun 2025 07:51:52 +0000 (09:51 +0200)
committerMarc Poulhiès <dkm@gcc.gnu.org>
Thu, 3 Jul 2025 08:16:30 +0000 (10:16 +0200)
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.

gcc/ada/gcc-interface/decl.cc

index 27d2cea1f3d2a4adf945c3532a7378d011f6f154..903ec844b96813cfaffe8b4e8b7eb07271ccd81b 100644 (file)
@@ -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 ();