> Am 05.10.2024 um 10:22 schrieb Eric Botcazou <botca...@adacore.com>:
> 
> Hi,
> 
> 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
> of 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 yet another declaration is used AFAICS).
> 
>  - gimple_add_init_for_auto_var uses EXPR_LOCATION to fetch the location of a
> DECL notes, which always returns UNKNOWN_LOCATION.
> 
>  - the machinery attempts to initialize Out parameters, which is problematic.
> 
> Tested on x86-64/Linux, OK for the mainline?
> 

Ok

Richard 

> 
> 2024-10-05  Eric Botcazou  <ebotca...@adacore.com>
> 
>    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.c (common_builtin_nodes): Remove the 3rd parameter in the
>    type of BUILT_IN_CLEAR_PADDING.
> 
> 
> 2024-10-05  Eric Botcazou  <ebotca...@adacore.com>
> 
> 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.
> 
> 
> 2024-10-05  Eric Botcazou  <ebotca...@adacore.com>
> 
> testsuite/
>    * gnat.dg/auto_var_init.adb: New test.
> 
> 
> --
> Eric Botcazou
> <pr116933.diff>
> <auto_var_init.adb>

Reply via email to