https://gcc.gnu.org/bugzilla/show_bug.cgi?id=116933
--- Comment #13 from GCC Commits <cvs-commit at gcc dot gnu.org> --- The master branch has been updated by Eric Botcazou <ebotca...@gcc.gnu.org>: https://gcc.gnu.org/g:a8e6360765336969e3f45ac16e4340e5e5468768 commit r15-4085-ga8e6360765336969e3f45ac16e4340e5e5468768 Author: Eric Botcazou <ebotca...@adacore.com> Date: Sat Oct 5 14:39:14 2024 +0200 Fix various issues of -ftrivial-auto-var-init=zero with Ada This polishes a few rough edges that prevent -ftrivial-auto-var-init=zero from working in Ada: - build_common_builtin_nodes declares BUILT_IN_CLEAR_PADDING with 3 instead 2 parameters, now gimple_fold_builtin_clear_padding contains the assertion: gcc_assert (gimple_call_num_args (stmt) == 2) This causes gimple_builtin_call_types_compatible_p to always return false in Ada (this works in C/C++ because another declaration is used). - gimple_add_init_for_auto_var uses EXPR_LOCATION to fetch the location of a DECL node, which always returns UNKNOWN_LOCATION. - the machinery attempts to initialize Out parameters. gcc/ PR middle-end/116933 * gimplify.cc (gimple_add_init_for_auto_var): Use the correct macro to fetch the source location of the variable. * tree.cc (common_builtin_nodes): Remove the 3rd parameter in the type of BUILT_IN_CLEAR_PADDING. gcc/ada/ PR middle-end/116933 * gcc-interface/decl.cc (gnat_to_gnu_entity) <E_Out_Parameter>: Add the "uninitialized" attribute on Out parameters. * gcc-interface/utils.cc (gnat_internal_attributes): Add entry for the "uninitialized" attribute. (handle_uninitialized_attribute): New function. gcc/testsuite/ * gnat.dg/auto_var_init.adb: New test.