public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
From: Alan Modra <amodra@bigpond.net.au>
To: nobody@gcc.gnu.org
Cc: gcc-prs@gcc.gnu.org,
Subject: Re: other/7114: ICE building strcoll.op from glibc-2.2.5
Date: Mon, 15 Jul 2002 02:36:00 -0000	[thread overview]
Message-ID: <20020715093603.8622.qmail@sources.redhat.com> (raw)

The following reply was made to PR other/7114; it has been noted by GNATS.

From: Alan Modra <amodra@bigpond.net.au>
To: d.mueller@elsoft.ch
Cc: gcc-gnats@gcc.gnu.org, gcc-patches@gcc.gnu.org,
  David Edelsohn <dje@watson.ibm.com>, geoffk@redhat.com
Subject: Re: other/7114: ICE building strcoll.op from glibc-2.2.5
Date: Mon, 15 Jul 2002 18:56:03 +0930

 This patch cures the testcase.  The !using_store_multiple code tests
 whether regs are live before saving.  We need to do something similar
 for using_store_multiple, in case all regs need not be saved.
 
 	* config/rs6000/rs6000.c (rs6000_emit_prologue): Trim saved regs
 	for -mmultiple case like -mno-multiple case.
 	(rs6000_emit_epilogue): Likewise.
 
 Index: gcc/config/rs6000/rs6000.c
 ===================================================================
 RCS file: /cvs/gcc/gcc/gcc/config/rs6000/rs6000.c,v
 retrieving revision 1.291.2.13
 diff -u -p -r1.291.2.13 rs6000.c
 --- gcc/config/rs6000/rs6000.c	23 May 2002 23:22:44 -0000	1.291.2.13
 +++ gcc/config/rs6000/rs6000.c	15 Jul 2002 09:06:31 -0000
 @@ -8836,30 +8836,45 @@ rs6000_emit_prologue ()
       the store-multiple instructions.  */
    if (using_store_multiple)
      {
 -      rtvec p, dwarfp;
 -      int i;
 -      p = rtvec_alloc (32 - info->first_gp_reg_save);
 -      dwarfp = rtvec_alloc (32 - info->first_gp_reg_save);
 -      for (i = 0; i < 32 - info->first_gp_reg_save; i++)
 +      int n = info->first_gp_reg_save;
 +
 +      while (n < 32
 +	     && !((regs_ever_live[n]
 +		   && ! call_used_regs[n])
 +		  || (n == RS6000_PIC_OFFSET_TABLE_REGNUM
 +		      && ((DEFAULT_ABI == ABI_V4 && flag_pic == 1)
 +			  || (DEFAULT_ABI == ABI_DARWIN && flag_pic)))))
 +	n++;
 +
 +      if (n < 32)
  	{
 -	  rtx addr, reg, mem;
 -	  reg = gen_rtx_REG (reg_mode, info->first_gp_reg_save + i);
 -	  addr = gen_rtx_PLUS (Pmode, frame_reg_rtx, 
 -			       GEN_INT (info->gp_save_offset 
 -					+ sp_offset 
 -					+ reg_size * i));
 -	  mem = gen_rtx_MEM (reg_mode, addr);
 -	  set_mem_alias_set (mem, rs6000_sr_alias_set);
 +	  rtvec p, dwarfp;
 +	  int i;
 +
 +	  p = rtvec_alloc (32 - n);
 +	  dwarfp = rtvec_alloc (32 - n);
 +	  for (i = 0; i < 32 - n; i++)
 +	    {
 +	      rtx addr, reg, mem;
 +	      reg = gen_rtx_REG (reg_mode, n + i);
 +	      addr = gen_rtx_PLUS (Pmode, frame_reg_rtx, 
 +				   GEN_INT (info->gp_save_offset 
 +					    + sp_offset 
 +					    + reg_size * i));
 +	      mem = gen_rtx_MEM (reg_mode, addr);
 +	      set_mem_alias_set (mem, rs6000_sr_alias_set);
  
 -	  RTVEC_ELT (p, i) = gen_rtx_SET (VOIDmode, mem, reg);
 +	      RTVEC_ELT (p, i) = gen_rtx_SET (VOIDmode, mem, reg);
 +	    }
 +	  insn = emit_insn (gen_rtx_PARALLEL (VOIDmode, p));
 +	  rs6000_frame_related (insn, frame_ptr_rtx, info->total_size, 
 +				NULL_RTX, NULL_RTX);
  	}
 -      insn = emit_insn (gen_rtx_PARALLEL (VOIDmode, p));
 -      rs6000_frame_related (insn, frame_ptr_rtx, info->total_size, 
 -			    NULL_RTX, NULL_RTX);
      }
    else
      {
        int i;
 +
        for (i = 0; i < 32 - info->first_gp_reg_save; i++)
  	if ((regs_ever_live[info->first_gp_reg_save+i] 
  	     && ! call_used_regs[info->first_gp_reg_save+i])
 @@ -9226,24 +9241,38 @@ rs6000_emit_epilogue (sibcall)
       the load-multiple instructions.  */
    if (using_load_multiple)
      {
 -      rtvec p;
 -      p = rtvec_alloc (32 - info->first_gp_reg_save);
 -      for (i = 0; i < 32 - info->first_gp_reg_save; i++)
 -	{
 -	  rtx addr = gen_rtx_PLUS (Pmode, frame_reg_rtx, 
 -				   GEN_INT (info->gp_save_offset 
 -					    + sp_offset 
 -					    + reg_size * i));
 -	  rtx mem = gen_rtx_MEM (reg_mode, addr);
 +      int n = info->first_gp_reg_save;
  
 -	  set_mem_alias_set (mem, rs6000_sr_alias_set);
 +      while (n < 32
 +	     && !((regs_ever_live[n]
 +		   && ! call_used_regs[n])
 +		  || (n == RS6000_PIC_OFFSET_TABLE_REGNUM
 +		      && ((DEFAULT_ABI == ABI_V4 && flag_pic == 1)
 +			  || (DEFAULT_ABI == ABI_DARWIN && flag_pic)))))
 +	n++;
 +
 +      if (n < 32)
 +	{
 +	  rtvec p;
  
 -	  RTVEC_ELT (p, i) = 
 -	    gen_rtx_SET (VOIDmode,
 -			 gen_rtx_REG (reg_mode, info->first_gp_reg_save + i),
 -			 mem);
 +	  p = rtvec_alloc (32 - n);
 +	  for (i = 0; i < 32 - n; i++)
 +	    {
 +	      rtx addr = gen_rtx_PLUS (Pmode, frame_reg_rtx, 
 +				       GEN_INT (info->gp_save_offset 
 +						+ sp_offset 
 +						+ reg_size * i));
 +	      rtx mem = gen_rtx_MEM (reg_mode, addr);
 +
 +	      set_mem_alias_set (mem, rs6000_sr_alias_set);
 +
 +	      RTVEC_ELT (p, i) = 
 +		gen_rtx_SET (VOIDmode,
 +			     gen_rtx_REG (reg_mode, n + i),
 +			     mem);
 +	    }
 +	  emit_insn (gen_rtx_PARALLEL (VOIDmode, p));
  	}
 -      emit_insn (gen_rtx_PARALLEL (VOIDmode, p));
      }
    else
      for (i = 0; i < 32 - info->first_gp_reg_save; i++)
 
 -- 
 Alan Modra
 IBM OzLabs - Linux Technology Centre


             reply	other threads:[~2002-07-15  9:36 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-07-15  2:36 Alan Modra [this message]
  -- strict thread matches above, loose matches on Subject: below --
2002-07-17 13:36 David Edelsohn
2002-07-17 12:16 Geoff Keating
2002-07-17 12:06 Geoff Keating
2002-07-17 10:46 David Edelsohn
2002-07-17  8:46 David Edelsohn
2002-07-17  2:06 Alan Modra
2002-07-17  0:16 Geoff Keating
2002-07-16 21:16 Alan Modra
2002-07-16 18:56 Alan Modra
2002-07-16 10:56 Geoff Keating
2002-07-16 10:46 Geoff Keating
2002-07-15 22:16 Alan Modra
2002-07-15 21:36 Richard Henderson
2002-07-15 18:46 Alan Modra
2002-07-15 16:56 Alan Modra
2002-07-15 12:46 Geoff Keating
2002-06-25  2:16 d.mueller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20020715093603.8622.qmail@sources.redhat.com \
    --to=amodra@bigpond.net.au \
    --cc=gcc-prs@gcc.gnu.org \
    --cc=nobody@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).