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]

PATCH - Fix for several -mcpu=G5 dejagnu test failures



This patch fixes save_stack_nonlocal/restore_stack_nonlocal when
invoked in -mcpu=G5 mode. word_mode is not correct when used to
generated addresses in -mcpu=G5. With this patch 160+ additional
dejagnu tests pass with -mcpu=G5.
Currently testing bootstrap, dejagnu testing on ppc-darwin. If they pass,
OK to commit to main line?


- Fariborz Jahanian <fjahanian@apple.com>


ChangeLog:


2004-01-22 Fariborz Jahanian <fjahanian@apple.com>

        * gcc/config/rs6000/rs6000.md (save_stack_nonlocal):
        Use adjust_address_nv directly with appropriate mode.
        (restore_stack_nonlocal): Ditto.


Index: rs6000.md =================================================================== RCS file: /cvs/gcc/gcc/gcc/config/rs6000/rs6000.md,v retrieving revision 1.285 diff -c -p -r1.285 rs6000.md *** rs6000.md 22 Jan 2004 02:44:34 -0000 1.285 --- rs6000.md 22 Jan 2004 19:18:39 -0000 *************** *** 9898,9910 **** " { rtx temp = gen_reg_rtx (Pmode);

/* Copy the backchain to the first word, sp to the second. */
emit_move_insn (temp, gen_rtx_MEM (Pmode, operands[1]));
! emit_move_insn (operand_subword (operands[0], 0, 0,
! (TARGET_32BIT ? DImode : TImode)),
! temp);
! emit_move_insn (operand_subword (operands[0], 1, 0, (TARGET_32BIT ? DImode : TImode)),
operands[1]);
DONE;
}")
--- 9898,9910 ----
"
{
rtx temp = gen_reg_rtx (Pmode);
+ int units_per_word = (TARGET_32BIT) ? 4 : 8;
+ enum machine_mode wmode = (TARGET_32BIT) ? SImode : word_mode;


/* Copy the backchain to the first word, sp to the second. */
emit_move_insn (temp, gen_rtx_MEM (Pmode, operands[1]));
! emit_move_insn (adjust_address_nv (operands[0], wmode, 0), temp);
! emit_move_insn (adjust_address_nv (operands[0], wmode, units_per_word),
operands[1]);
DONE;
}")
***************
*** 9916,9928 ****
"
{
rtx temp = gen_reg_rtx (Pmode);


/* Restore the backchain from the first word, sp from the second. */
emit_move_insn (temp,
! operand_subword (operands[1], 0, 0, (TARGET_32BIT ? DImode : TImode)));
emit_move_insn (operands[0],
! operand_subword (operands[1], 1, 0,
! (TARGET_32BIT ? DImode : TImode)));
emit_move_insn (gen_rtx_MEM (Pmode, operands[0]), temp);
DONE;
}")
--- 9916,9929 ----
"
{
rtx temp = gen_reg_rtx (Pmode);
+ int units_per_word = (TARGET_32BIT) ? 4 : 8;
+ enum machine_mode wmode = (TARGET_32BIT) ? SImode : word_mode;


/* Restore the backchain from the first word, sp from the second. */
emit_move_insn (temp,
! adjust_address_nv (operands[1], wmode, 0));
emit_move_insn (operands[0],
! adjust_address_nv (operands[1], wmode, units_per_word));
emit_move_insn (gen_rtx_MEM (Pmode, operands[0]), temp);
DONE;
}")



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