From: Eric Botcazou Date: Sat, 11 Apr 2020 16:28:49 +0000 (+0200) Subject: [Ada] Work around problematic interaction with public symbol generation X-Git-Tag: basepoints/gcc-12~6839 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d27ec3f60a3ac5eab05765cbbf45083e4e3dabc6;p=thirdparty%2Fgcc.git [Ada] Work around problematic interaction with public symbol generation 2020-06-17 Eric Botcazou gcc/ada/ * exp_attr.adb (Expand_N_Attribute_Reference) : Do not replace the bound for an array type if it is public. --- diff --git a/gcc/ada/exp_attr.adb b/gcc/ada/exp_attr.adb index 51cda8299ece..ea36be02100a 100644 --- a/gcc/ada/exp_attr.adb +++ b/gcc/ada/exp_attr.adb @@ -3424,7 +3424,14 @@ package body Exp_Attr is -- reference. Note that this must be in keeping with what is done -- for scalar types in order for range checks to be elided in loops. - elsif Is_Array_Type (Ptyp) and then Is_Constrained (Ptyp) then + -- However, avoid doing it if the array type is public because, in + -- this case, we effectively rely on the back end to create public + -- symbols with consistent names across units for the array bounds. + + elsif Is_Array_Type (Ptyp) + and then Is_Constrained (Ptyp) + and then not Is_Public (Ptyp) + then declare Bnd : Node_Id;