This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: ARM: Invalid Stack Alignment BUG
- To: law at cygnus dot com
- Subject: Re: ARM: Invalid Stack Alignment BUG
- From: Richard Earnshaw <rearnsha at arm dot com>
- Date: Tue, 14 Mar 2000 17:50:33 +0000
- Cc: Craig Newell <CraigN at cheque dot uq dot edu dot au>, gcc-patches at gcc dot gnu dot org, hubicka at freesoft dot cz
- Cc: rearnsha at arm dot com
- Organization: ARM Ltd.
- Reply-To: rearnsha at arm dot com
>
> In message <200003131602.QAA16283@cam-mail2.cambridge.arm.com>you write:
> > Craig,
> >
> > Thanks for looking into this. However, I'm not convinced that it correct
> > to fix this in the back end (as I think you are implying). I haven't
> > checked in detail but my gut feeling is that if the stack-frame is
> > unaligned during reload, then unallocated pseudos may get pushed at
> > unaligned addresses, which could cause all sorts of carnage.
> >
> > Jan, why does cfun->stack_alignment_needed not have a minimum value of
> > STACK_BOUNDARY?
> Agreed. I can't think of any case where stack_alignment_needed should be
> less than STACK_BOUNDARY.
>
Good. Following patch applied.
2000-03-14 Richard Earnshaw <rearnsha@arm.com>
* function.c (prepare_function_start): Correctly initialize
cfun->stack_alignment_needed.
Index: function.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/function.c,v
retrieving revision 1.173
diff -u -p -r1.173 function.c
--- function.c 2000/03/09 19:01:47 1.173
+++ function.c 2000/03/14 17:36:33
@@ -5751,9 +5751,11 @@ prepare_function_start ()
cfun->original_decl_initial = 0;
cfun->original_arg_vector = 0;
- cfun->stack_alignment_needed = 0;
#ifdef STACK_BOUNDARY
+ cfun->stack_alignment_needed = STACK_BOUNDARY;
cfun->preferred_stack_boundary = STACK_BOUNDARY;
+#else
+ cfun->stack_alignment_needed = 0;
#endif
/* Set if a call to setjmp is seen. */