From 01cd0938b55019565dd76224d0b20edfbd496cc6 Mon Sep 17 00:00:00 2001 From: Arnaud Charlet Date: Fri, 17 Apr 2009 14:36:38 +0200 Subject: [multiple changes] 2009-04-17 Robert Dewar * exp_ch5.adb (Expand_Assign_Array): Do not set Forwards_OK and Backwards_OK if either operand has an address clause. 2009-04-17 Pascal Obry * initialize.c: Code clean up, use realloc. From-SVN: r146259 --- gcc/ada/ChangeLog | 9 +++++++++ gcc/ada/exp_ch5.adb | 13 +++++++++++++ gcc/ada/initialize.c | 29 ++++------------------------- 3 files changed, 26 insertions(+), 25 deletions(-) diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index edb0bab..5b8d3a1 100644 --- a/gcc/ada/ChangeLog +++ b/gcc/ada/ChangeLog @@ -1,3 +1,12 @@ +2009-04-17 Robert Dewar + + * exp_ch5.adb (Expand_Assign_Array): Do not set Forwards_OK and + Backwards_OK if either operand has an address clause. + +2009-04-17 Pascal Obry + + * initialize.c: Code clean up, use realloc. + 2009-04-17 Pascal Obry * initialize.c: Do not get Unicode command line if Unicode support not diff --git a/gcc/ada/exp_ch5.adb b/gcc/ada/exp_ch5.adb index b51e8d2..c025f58 100644 --- a/gcc/ada/exp_ch5.adb +++ b/gcc/ada/exp_ch5.adb @@ -308,6 +308,19 @@ package body Exp_Ch5 is -- can be performed directly. end if; + -- If either operand has an address clause clear Backwards_OK and + -- Forwards_OK, since we cannot tell if the operands overlap. + + if (Is_Entity_Name (Lhs) + and then Present (Address_Clause (Entity (Lhs)))) + or else + (Is_Entity_Name (Lhs) + and then Present (Address_Clause (Entity (Lhs)))) + then + Set_Forwards_OK (N, False); + Set_Backwards_OK (N, False); + end if; + -- We certainly must use a loop for change of representation and also -- we use the operand of the conversion on the right hand side as the -- effective right hand side (the component types must match in this diff --git a/gcc/ada/initialize.c b/gcc/ada/initialize.c index 67e2acd..5a1417b 100644 --- a/gcc/ada/initialize.c +++ b/gcc/ada/initialize.c @@ -45,6 +45,7 @@ #include "tsystem.h" /* We don't have libiberty, so use malloc. */ #define xmalloc(S) malloc (S) +#define xrealloc(V,S) realloc (V,S) #else #include "config.h" #include "system.h" @@ -83,17 +84,8 @@ append_arg (int *index, LPWSTR value, char ***argv, int *last) if (*last < *index) { - char **old_argv = *argv; - int old_last = *last; - int k; - *last += EXPAND_ARGV_RATE; - *argv = (char **) xmalloc ((*last) * sizeof (char *)); - - for (k=0; k<=old_last; k++) - (*argv)[k] = old_argv[k]; - - free (old_argv); + *argv = (char **) xrealloc (*argv, (*last) * sizeof (char *)); } size = WS2SC (NULL, value, 0); @@ -102,20 +94,6 @@ append_arg (int *index, LPWSTR value, char ***argv, int *last) (*index)++; } - -static void -adjust_arg (int last, char ***argv) -{ - char **old_argv = *argv; - int k; - - *argv = (char **) xmalloc (last * sizeof (char *)); - - for (k=0; k