From 577c42f19ee102b1f0a1132f74bbcce4971c3404 Mon Sep 17 00:00:00 2001 From: fjahanian Date: Wed, 4 May 2005 22:44:14 +0000 Subject: [PATCH] Fixed a vrsave problem in the presense of save_world call in the prologue. Oked by Dale Johannesen. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@99236 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/ChangeLog | 6 ++++++ gcc/config/rs6000/rs6000.c | 19 +++++++++++-------- 2 files changed, 17 insertions(+), 8 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index eed5263bad1..c2624bcbc0f 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2005-05-04 Fariborz Jahanian + + * config/rs6000/rs6000.c (rs6000_emit_prologue): Emit + setting of vrsave register for current function after + call to save_world is emitted. + 2005-05-05 Hans-Peter Nilsson * config/mmix/predicates.md: New file. diff --git a/gcc/config/rs6000/rs6000.c b/gcc/config/rs6000/rs6000.c index acf6357272d..5779d1f88ee 100644 --- a/gcc/config/rs6000/rs6000.c +++ b/gcc/config/rs6000/rs6000.c @@ -13271,7 +13271,7 @@ rs6000_emit_prologue (void) epilogue. */ if (TARGET_ALTIVEC && TARGET_ALTIVEC_VRSAVE - && !WORLD_SAVE_P (info) && info->vrsave_mask != 0) + && info->vrsave_mask != 0) { rtx reg, mem, vrsave; int offset; @@ -13286,13 +13286,16 @@ rs6000_emit_prologue (void) else emit_insn (gen_rtx_SET (VOIDmode, reg, vrsave)); - /* Save VRSAVE. */ - offset = info->vrsave_save_offset + sp_offset; - mem - = gen_rtx_MEM (SImode, - gen_rtx_PLUS (Pmode, frame_reg_rtx, GEN_INT (offset))); - set_mem_alias_set (mem, rs6000_sr_alias_set); - insn = emit_move_insn (mem, reg); + if (!WORLD_SAVE_P (info)) + { + /* Save VRSAVE. */ + offset = info->vrsave_save_offset + sp_offset; + mem + = gen_rtx_MEM (SImode, + gen_rtx_PLUS (Pmode, frame_reg_rtx, GEN_INT (offset))); + set_mem_alias_set (mem, rs6000_sr_alias_set); + insn = emit_move_insn (mem, reg); + } /* Include the registers in the mask. */ emit_insn (gen_iorsi3 (reg, reg, GEN_INT ((int) info->vrsave_mask))); -- 2.11.4.GIT