This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [Ada] Workaround for bootstrap problem on PPC/S390 (PR19853)


Richard Kenner wrote:
> 
>     -      Lib_Opts : Argument_List_Access := No_Argument'Unrestricted_Access;
>     +      Lib_Opts : Argument_List_Access := No_Argument'Access;
> 
> This is weird in the extreme.  There don't appear to be any differences in
> code generation in this case between the two attributes: the only difference
> is in validity checks.

Actually, there *is* a different in the generated code; with 'Access
we get (in the pr19865.adb.02.original tree dump):

struct pr19865__integer_list_access lib_opts = 
  VIEW_CONVERT_EXPR<struct pr19865__integer_list_access>
  ({.P_ARRAY=(integer[(long int) <PLACEHOLDER_EXPR struct pr19865__integer_list_access>.P_BOUNDS->LB0
                     :(long int) <PLACEHOLDER_EXPR struct pr19865__integer_list_access>.P_BOUNDS->UB0] *)
             &pr19865__no_argument.ARRAY,
    .P_BOUNDS=&pr19865__no_argument.BOUNDS});

while with 'Unrestricted_Access we have:

struct pr19865__integer_list_access lib_opts =
  VIEW_CONVERT_EXPR<struct pr19865__integer_list_access>
  ({.P_ARRAY=(integer[(long int) <PLACEHOLDER_EXPR struct pr19865__integer_list_access>.P_BOUNDS->LB0
                     :(long int) <PLACEHOLDER_EXPR struct pr19865__integer_list_access>.P_BOUNDS->UB0] *)
             (integer[1:0] *) ((void *) &pr19865__no_argument + 8B),
    .P_BOUNDS=&{.LB0=1, .UB0=0}});

Only in the latter case does the gimplification done during SRA need to allocate
a new temporary variable (to hold the {.LB0=1, .UB0=0}).

Bye,
Ulrich

-- 
  Dr. Ulrich Weigand
  Linux on zSeries Development
  Ulrich.Weigand@de.ibm.com


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]