public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
From: Jim Wilson <wilson@tuliptree.org>
To: wilson@gcc.gnu.org
Cc: gcc-prs@gcc.gnu.org,
Subject: Re: c/7871: ICE on legal code, global register variables problems
Date: Fri, 28 Feb 2003 03:26:00 -0000	[thread overview]
Message-ID: <20030228032600.32258.qmail@sources.redhat.com> (raw)

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

From: Jim Wilson <wilson@tuliptree.org>
To: gcc-gnats@gcc.gnu.org,  gcc-bugs@gcc.gnu.org,  gcc-prs@gcc.gnu.org, 
 rz@linux-m68k.org,  wilson@gcc.gnu.org,  rth@redhat.com
Cc:  
Subject: Re: c/7871: ICE on legal code, global register variables problems
Date: Thu, 27 Feb 2003 22:23:53 -0500

 This is a multi-part message in MIME format.
 --------------060600050902010009060203
 Content-Type: text/plain; charset=us-ascii; format=flowed
 Content-Transfer-Encoding: 7bit
 
 http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=7871
 
 PR 7871 was broken by this patch from Richard Henderson
 	http://gcc.gnu.org/ml/gcc-patches/2001-07/msg01050.html
 
 This PR uses a global register, and a store to the global register 
 before a call gets deleted as a dead store.
 
 The problem with this patch is that it doesn't distinguish between 
 regsters which are definitely set by calls, and registers which might be 
 set by calls.  In both cases, we can't do optimizations like cse across 
 the call.  However, only in the former case can we delete stores before 
 the call as dead.  In the latter case, a store before the call is not 
 dead, because the register might not be set in the call.
 
 I think every part of the patch is right except for the flow.c change. 
 The flow.c change marks global regs as killed by calls which is not 
 correct.  They might be killed, but we can't assume that, because then 
 we might delete a store that isn't dead.
 
 I propose the following patch to fix the bug.  I will check it in after 
 running the tests, and add the testcase to the testsuite if there isn't 
 already an equivalent one.
 
 Jim
 
 
 --------------060600050902010009060203
 Content-Type: text/plain;
  name="tmp.file"
 Content-Transfer-Encoding: 7bit
 Content-Disposition: inline;
  filename="tmp.file"
 
 2003-02-27  James E Wilson  <wilson@tuliptree.org>
 
 	* flow.c (propagate_one_insn): Don't assume that calls set global
 	registers.
 
 Index: flow.c
 ===================================================================
 RCS file: /cvs/gcc/gcc/gcc/flow.c,v
 retrieving revision 1.548
 diff -p -r1.548 flow.c
 *** flow.c	31 Jan 2003 06:52:48 -0000	1.548
 --- flow.c	28 Feb 2003 03:14:51 -0000
 *************** propagate_one_insn (pbi, insn)
 *** 1798,1806 ****
   	      mark_set_1 (pbi, CLOBBER, XEXP (XEXP (note, 0), 0),
   			  cond, insn, pbi->flags);
   
 ! 	  /* Calls change all call-used and global registers.  */
   	  for (i = 0; i < FIRST_PSEUDO_REGISTER; i++)
 ! 	    if (TEST_HARD_REG_BIT (regs_invalidated_by_call, i))
   	      {
   		/* We do not want REG_UNUSED notes for these registers.  */
   		mark_set_1 (pbi, CLOBBER, regno_reg_rtx[i], cond, insn,
 --- 1798,1810 ----
   	      mark_set_1 (pbi, CLOBBER, XEXP (XEXP (note, 0), 0),
   			  cond, insn, pbi->flags);
   
 ! 	  /* Calls change all call-used registers.  Calls may or may not
 ! 	     change global registers.  Since this will cause previous stores
 ! 	     to be deleted as dead, we must assume that global registers are
 ! 	     not set in the call.  */
   	  for (i = 0; i < FIRST_PSEUDO_REGISTER; i++)
 ! 	    if (TEST_HARD_REG_BIT (regs_invalidated_by_call, i)
 ! 		&& ! global_regs[i])
   	      {
   		/* We do not want REG_UNUSED notes for these registers.  */
   		mark_set_1 (pbi, CLOBBER, regno_reg_rtx[i], cond, insn,
 
 --------------060600050902010009060203--
 


             reply	other threads:[~2003-02-28  3:26 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-02-28  3:26 Jim Wilson [this message]
  -- strict thread matches above, loose matches on Subject: below --
2003-05-02 14:16 Richard Zidlicky
2003-05-02 12:26 Richard Zidlicky
2003-05-01  6:06 Jim Wilson
2003-04-06 19:46 Jim Wilson
2003-04-02 20:56 Richard Zidlicky
2003-03-10  5:16 Jim Wilson
2003-02-28 16:46 Jim Wilson
2003-02-28  5:56 Richard Henderson
2003-02-28  3:02 wilson
2002-12-14 12:56 Richard Zidlicky
2002-09-09 14:36 Richard Zidlicky

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=20030228032600.32258.qmail@sources.redhat.com \
    --to=wilson@tuliptree.org \
    --cc=gcc-prs@gcc.gnu.org \
    --cc=wilson@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).