Re: [Patch]: Fix very large frame bug on i386

2012-05-25 Thread Tristan Gingold

On May 22, 2012, at 7:17 PM, Richard Henderson wrote:

 On 05/15/12 02:10, Tristan Gingold wrote:
 2012-05-15  Tristan Gingold  ging...@adacore.com
 
  * config/i386/i386.c (struct ix86_frame): Remove unused frame field.
  (ix86_compute_frame_layout): Fix type of stack_alignment_needed
  and preferred_alignment.
 
 Ok with a test case.  Even if it's a scan-assember sort of test.

Thanks, now committed with the following testcase:

/* { dg-do compile } */
/* { dg-require-effective-target lp64 } */
/* { dg-final { scan-assembler -429496 } } */
extern void dump (int *buf, int a);

void func (int a)
{
  int bigbuf[1  30];
  dump (bigbuf, a);
}


Tristan.



Re: [Patch]: Fix very large frame bug on i386

2012-05-22 Thread Richard Henderson
On 05/15/12 02:10, Tristan Gingold wrote:
 2012-05-15  Tristan Gingold  ging...@adacore.com
 
   * config/i386/i386.c (struct ix86_frame): Remove unused frame field.
   (ix86_compute_frame_layout): Fix type of stack_alignment_needed
   and preferred_alignment.

Ok with a test case.  Even if it's a scan-assember sort of test.


r~


Re: [Patch]: Fix very large frame bug on i386

2012-05-21 Thread Tristan Gingold
Ping for:

On May 15, 2012, at 11:10 AM, Tristan Gingold wrote:

 Hi,
 
 use of 'unsigned int' for i386.c:ix86_compute_frame_layout 
 stack_alignment_needed results in truncation of frame offset in code such as:
 
 offset = (offset + stack_alignment_needed - 1)  -stack_alignment_needed
 
 (as it is -stack_alignment_needed that is converted to HOST_WIDE_INT).
 
 As a consequence, frames larger than 4GB are squeezed.
 
 Also, the frame field of struct ix86_frame is never used.
 
 Bootstrapped and reg-tested on x86_64 GNU/Linux, without regressions.
 
 Ok for trunk ?
 
 Tristan.
 
 2012-05-15  Tristan Gingold  ging...@adacore.com
 
   * config/i386/i386.c (struct ix86_frame): Remove unused frame field.
   (ix86_compute_frame_layout): Fix type of stack_alignment_needed
   and preferred_alignment.
 
 diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c
 index ad4739b..353ee53 100644
 --- a/gcc/config/i386/i386.c
 +++ b/gcc/config/i386/i386.c
 @@ -2408,7 +2408,6 @@ struct ix86_frame
   int va_arg_size;
   int red_zone_size;
   int outgoing_arguments_size;
 -  HOST_WIDE_INT frame;
 
   /* The offsets relative to ARG_POINTER.  */
   HOST_WIDE_INT frame_pointer_offset;
 @@ -8937,9 +8936,9 @@ ix86_builtin_setjmp_frame_value (void)
 static void
 ix86_compute_frame_layout (struct ix86_frame *frame)
 {
 -  unsigned int stack_alignment_needed;
 +  unsigned HOST_WIDE_INT stack_alignment_needed;
   HOST_WIDE_INT offset;
 -  unsigned int preferred_alignment;
 +  unsigned HOST_WIDE_INT preferred_alignment;
   HOST_WIDE_INT size = get_frame_size ();
   HOST_WIDE_INT to_allocate;
 
 



[Patch]: Fix very large frame bug on i386

2012-05-15 Thread Tristan Gingold
Hi,

use of 'unsigned int' for i386.c:ix86_compute_frame_layout 
stack_alignment_needed results in truncation of frame offset in code such as:

 offset = (offset + stack_alignment_needed - 1)  -stack_alignment_needed

(as it is -stack_alignment_needed that is converted to HOST_WIDE_INT).

As a consequence, frames larger than 4GB are squeezed.

Also, the frame field of struct ix86_frame is never used.

Bootstrapped and reg-tested on x86_64 GNU/Linux, without regressions.

Ok for trunk ?

Tristan.

2012-05-15  Tristan Gingold  ging...@adacore.com

* config/i386/i386.c (struct ix86_frame): Remove unused frame field.
(ix86_compute_frame_layout): Fix type of stack_alignment_needed
and preferred_alignment.

diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c
index ad4739b..353ee53 100644
--- a/gcc/config/i386/i386.c
+++ b/gcc/config/i386/i386.c
@@ -2408,7 +2408,6 @@ struct ix86_frame
   int va_arg_size;
   int red_zone_size;
   int outgoing_arguments_size;
-  HOST_WIDE_INT frame;
 
   /* The offsets relative to ARG_POINTER.  */
   HOST_WIDE_INT frame_pointer_offset;
@@ -8937,9 +8936,9 @@ ix86_builtin_setjmp_frame_value (void)
 static void
 ix86_compute_frame_layout (struct ix86_frame *frame)
 {
-  unsigned int stack_alignment_needed;
+  unsigned HOST_WIDE_INT stack_alignment_needed;
   HOST_WIDE_INT offset;
-  unsigned int preferred_alignment;
+  unsigned HOST_WIDE_INT preferred_alignment;
   HOST_WIDE_INT size = get_frame_size ();
   HOST_WIDE_INT to_allocate;