> Tested on x86-64/Linux, applied on the mainline, 11 and 10 branches.
> 
> 
> 2021-05-21  Eric Botcazou  <ebotca...@adacore.com>
> 
>       * gcc-interface/decl.c (gnat_to_gnu_subprog_type): Always translate
>       the Is_Pure flag into the "pure" attribute of GNU C.

This is the missing piece, applied on the same branches.

        * gcc-interface/utils.c (finish_subprog_decl): Remove obsolete line.

-- 
Eric Botcazou
diff --git a/gcc/ada/gcc-interface/utils.c b/gcc/ada/gcc-interface/utils.c
index 982274c6d77..535f4ca7fba 100644
--- a/gcc/ada/gcc-interface/utils.c
+++ b/gcc/ada/gcc-interface/utils.c
@@ -3543,9 +3543,6 @@ finish_subprog_decl (tree decl, tree asm_name, tree type)
   DECL_BY_REFERENCE (result_decl) = TREE_ADDRESSABLE (type);
   DECL_RESULT (decl) = result_decl;
 
-  /* Propagate the "const" property.  */
-  TREE_READONLY (decl) = TYPE_READONLY (type);
-
   /* Propagate the "pure" property.  */
   DECL_PURE_P (decl) = TYPE_RESTRICT (type);
 

Reply via email to