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: [PATCH] [ARM] PR45701 testcase fix.


On 04/03/15 11:13, Alex Velenko wrote:
> Hi,
> 
> This patch fixes arm pr45701 scan assembly tests. Those test register r3 being
> used to maintain stack double word alignment. Recent optimizations reduced
> number of local variables needed in those tests, removing necessity to push r3.
> Testcase fixed by adding additional local variable.
> 
> Is patch OK?
> 

This patch is OK.

Let me put it on record that I really dislike these scan-assembler tests
that rely on specific behaviours throughout the entire compilation flow.
 They're just too fragile to be useful.

R.

> 2015-03-04  Alex Velenko  <Alex.Velenko@arm.com>
> 
> gcc/testsuite
> 
> 	* gcc.target/arm/pr45701-1.c (history_expand_line_internal): Add an
> 	extra variable to force stack alignment.
> 	* gcc.target/arm/pr45701-2.c (history_expand_line_internal): Add an
> 	extra variable to force stack alignment.
> ---
>  gcc/testsuite/gcc.target/arm/pr45701-1.c | 5 +++--
>  gcc/testsuite/gcc.target/arm/pr45701-2.c | 5 +++--
>  2 files changed, 6 insertions(+), 4 deletions(-)
> 
> diff --git a/gcc/testsuite/gcc.target/arm/pr45701-1.c b/gcc/testsuite/gcc.target/arm/pr45701-1.c
> index 2c690d5..454a087 100644
> --- a/gcc/testsuite/gcc.target/arm/pr45701-1.c
> +++ b/gcc/testsuite/gcc.target/arm/pr45701-1.c
> @@ -5,6 +5,7 @@
>  /* { dg-final { scan-assembler-not "r8" } } */
>  
>  extern int hist_verify;
> +extern int a1;
>  extern char *pre_process_line (char*);
>  extern char* str_cpy (char*, char*);
>  extern int str_len (char*);
> @@ -16,10 +17,10 @@ history_expand_line_internal (char* line)
>  {
>    char *new_line;
>    int old_verify;
> -
> +  int a = a1;
>    old_verify = hist_verify;
>    hist_verify = 0;
>    new_line = pre_process_line (line);
> -  hist_verify = old_verify;
> +  hist_verify = old_verify + a;
>    return (new_line == line) ? savestring (line) : new_line;
>  }
> diff --git a/gcc/testsuite/gcc.target/arm/pr45701-2.c b/gcc/testsuite/gcc.target/arm/pr45701-2.c
> index ee1ee7d..afe0840 100644
> --- a/gcc/testsuite/gcc.target/arm/pr45701-2.c
> +++ b/gcc/testsuite/gcc.target/arm/pr45701-2.c
> @@ -5,6 +5,7 @@
>  /* { dg-final { scan-assembler-not "r8" } } */
>  
>  extern int hist_verify;
> +extern int a1;
>  extern char *pre_process_line (char*);
>  extern char* savestring1 (char*, char*);
>  extern char* str_cpy (char*, char*);
> @@ -17,11 +18,11 @@ history_expand_line_internal (char* line)
>  {
>    char *new_line;
>    int old_verify;
> -
> +  int a = a1;
>    old_verify = hist_verify;
>    hist_verify = 0;
>    new_line = pre_process_line (line);
> -  hist_verify = old_verify;
> +  hist_verify = old_verify + a;
>    /* Two tail calls here, but r3 is not used to pass values.  */
>    return (new_line == line) ? savestring (line) : savestring1 (new_line, line);
>  }
> 


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