[PATCH] Fix part of pr25505

Josh Conner jconner@apple.com
Fri Sep 8 16:21:00 GMT 2006


*ping*

This is trivial, but perhaps not "obvious" -- ok for mainline?

- Josh

Josh Conner wrote:
> Josh Conner wrote:
> 
>>> Can it be that either of this caused
>>>
>>> FAIL: gcc.dg/nrv3.c scan-tree-dump-times return slot optimization 2
>>> FAIL: gnat.dg/frame_overflow.adb  (test for errors, line 12)
>>> FAIL: gnat.dg/frame_overflow.adb  (test for errors, line 21)
>>>
>>> on x86_64?
>> The first failure is a test I added, sounds like it doesn't work under
>> x86_64 for some reason.  The others, I don't know.  I'll take a look at
>> all three of these.
> 
> Based on Eric's comments, I won't look into the gnat.dg failures.
> 
> The problem with nrv3.c is that the structure:
> 
>   typedef struct { int x; void *y; } S;
> 
> is being returned in registers instead of memory on the x86_64, and so
> isn't available for return slot optimization.  The attached patch fixes
> it by increasing the size of the structure.  Note that it makes the same
> change in nrv[45].c, which are negative tests of this same functionality.
> 
> OK?
> 
> - Josh
> 
> 2006-09-01  Josh Conner  <jconner@apple.com>
> 
> 	* gcc.dg/nrv3.c: Increase size of structure.
> 	* gcc.dg/nrv4.c: Likewise.
> 	* gcc.dg/nrv5.c: Likewise.
> 
> 
> ------------------------------------------------------------------------
> 
> Index: gcc/testsuite/gcc.dg/nrv3.c
> ===================================================================
> --- gcc/testsuite/gcc.dg/nrv3.c	(revision 116642)
> +++ gcc/testsuite/gcc.dg/nrv3.c	(working copy)
> @@ -3,7 +3,7 @@
>  /* { dg-do compile } */
>  /* { dg-options "-O -fdump-tree-optimized" } */
>  
> -typedef struct { int x; void *y; } S;
> +typedef struct { int x[20]; void *y; } S;
>  typedef struct { int a; S b; } T;
>  S nrv_candidate (void);
>  void use_result (S, int);
> Index: gcc/testsuite/gcc.dg/nrv4.c
> ===================================================================
> --- gcc/testsuite/gcc.dg/nrv4.c	(revision 116642)
> +++ gcc/testsuite/gcc.dg/nrv4.c	(working copy)
> @@ -3,7 +3,7 @@
>  /* { dg-do compile } */
>  /* { dg-options "-O -fdump-tree-optimized" } */
>  
> -typedef struct { int x; void *y; } S;
> +typedef struct { int x[20]; void *y; } S;
>  S nrv_candidate (void);
>  void use_result (S);
>  void make_escape (S *);
> Index: gcc/testsuite/gcc.dg/nrv5.c
> ===================================================================
> --- gcc/testsuite/gcc.dg/nrv5.c	(revision 116642)
> +++ gcc/testsuite/gcc.dg/nrv5.c	(working copy)
> @@ -3,7 +3,7 @@
>  /* { dg-do compile } */
>  /* { dg-options "-O -fdump-tree-optimized" } */
>  
> -typedef struct { int x; void *y; } S;
> +typedef struct { int x[20]; void *y; } S;
>  typedef struct { int a; S b; } T;
>  S nrv_candidate (void);
>  void use_result (S);



More information about the Gcc-patches mailing list