On 22/12/13 17:42, Eric Botcazou wrote:
> Hi,
> 
> this is the last issue with nested APCS frames according to our testing.  
> When 
> the IP register needs to be preserved on entry and r3 isn't free and there are
> no arguments to push, the prologue creates a slot above the frame, so various 
> internal offsets need to be adjusted.  One has been missed, leading to:
> 
>       sub     ip, fp, #20
>       fldmfdd ip!, {d8}
>       sub     sp, fp, #16
>       ldmfd   sp, {r3, fp, sp, pc}
> 
> in the epilogue of the nested frame.  That's wrong because the difference 
> between the 2 immediates must be equal to the size of the saved FP registers.
> 
> Tested on ARM/VxWorks (where it fixes several ACATS tests at -O2) and 
> ARM/EABI, OK for the mainline?
> 
> 
> 2013-12-22  Eric Botcazou  <ebotca...@adacore.com>
> 
>       * config/arm/arm.c (arm_get_frame_offsets): Revamp long lines.
>       (arm_expand_epilogue_apcs_frame): Take into account the number of bytes
>       used to save the static chain register in the computation of the offset
>       from which the FP registers need to be restored.
> 
> 
> 2013-12-22  Eric Botcazou  <ebotca...@adacore.com>
> 
>       * gcc.target/arm/neon-nested-apcs.c: New test.
> 
> 

OK, modulo the 2 nits below.

>    /* In Thumb mode this is incorrect, but never used.  */
> -  offsets->frame = offsets->saved_args + (frame_pointer_needed ? 4 : 0) +
> -                   arm_compute_static_chain_stack_bytes();
> +  offsets->frame
> +    = offsets->saved_args
> +     + arm_compute_static_chain_stack_bytes ()
> +     + (frame_pointer_needed ? 4 : 0);

There should be brackets around the entire expression when split across
mulitple lines, so that auto-indentation is correctly preserved: ie

  offsets->frame
    = (expression_in_backets_when
       - over_mulitple_lines);

>    /* Find the offset of the floating-point save area in the frame.  */
> -  floats_from_frame = offsets->saved_args - offsets->frame;
> +  floats_from_frame
> +    = offsets->saved_args
> +     + arm_compute_static_chain_stack_bytes ()
> +     - offsets->frame;
>  

Same here.

R.

Reply via email to