public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
From: Richard Henderson <rth@redhat.com>
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 05:56:00 -0000	[thread overview]
Message-ID: <20030228055600.15790.qmail@sources.redhat.com> (raw)

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

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

 On Thu, Feb 27, 2003 at 10:23:53PM -0500, Jim Wilson wrote:
 > ! 	  /* 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])
 
 I don't think this is right.  The call may change the variable.
 If we don't mark the value set, we won't have proper log_links.
 
 The register was *supposed* to be marked used by 
 
           /* Calls may also reference any of the global registers,
              so they are made live.  */
           for (i = 0; i < FIRST_PSEUDO_REGISTER; i++)
             if (global_regs[i])
               mark_used_reg (pbi, regno_reg_rtx[i], cond, insn);
 
 so I'm not sure where we went wrong...
 
 A test case that I think may fail with your change is
 
 	register int d __asm__("d7");
 	void bar()
 	{
 	  if (d != 1)
 	    abort();
 	  d = 4;
 	}
 	void baz()
 	{
 	  if (d != 6)
 	    abort();
 	}
 	int main()
 	{
 	  d = 1;
 	  bar();
 	  d |= 2;
 	  baz();
 	  return 0;
 	}
 
 If log_links are wrong, combine will see d=1 linked with d|=2 and
 produce d=3.
 
 
 r~


             reply	other threads:[~2003-02-28  5:56 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-02-28  5:56 Richard Henderson [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  3:26 Jim Wilson
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=20030228055600.15790.qmail@sources.redhat.com \
    --to=rth@redhat.com \
    --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).