public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
From: Richard Zidlicky <rz@linux-m68k.org>
To: gcc-gnats@gcc.gnu.org
Subject: c/7871: ICE on legal code, global register variables problems
Date: Mon, 09 Sep 2002 14:36:00 -0000	[thread overview]
Message-ID: <200209092059.WAA05222@rz.de> (raw)


>Number:         7871
>Category:       c
>Synopsis:       ICE on legal code, global register variables problems
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          ice-on-legal-code
>Submitter-Id:   net
>Arrival-Date:   Mon Sep 09 14:36:00 PDT 2002
>Closed-Date:
>Last-Modified:
>Originator:     Richard Zidlicky
>Release:        3.2
>Organization:
>Environment:

native and crosscompiled

target: m68k-unknown-linux-gnu
configured with: ../gcc-3.2/configure --enable-languages=c --disable-checking --with-newlib --without-headers --target=m68k-linux
>Description:

attached test program causes internal error. In other similar cases
gcc will emit wrong code, omitting stores to global register variables
which it falsely considers dead.

This is a regression from gcc 3.0, and 2.9*

/data/rz/build-m68k-3.2-release/gcc/cc1 -O1  -m68020-60 x4m68k.i
x4.c: In function `foo':
x4.c:23: Internal compiler error in verify_wide_reg, at flow.c:557
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://www.gnu.org/software/gcc/bugs.html> for instructions.
        .file   "x4m68k.i"


	
>How-To-Repeat:

# 1 "x4.c"
# 1 "<built-in>"
# 1 "<command line>"
# 1 "x4.c"

void bar(void);

extern int x1;


register int g1 asm("%d7");
# 19 "x4.c"
void foo(void)
{
     g1=999;
     bar();
}


>Fix:

This patch cures the problem:

--- gcc-3.2-cvs/gcc/flow.c.rz	Thu Apr 18 16:21:09 2002
+++ gcc-3.2-cvs/gcc/flow.c	Wed Aug 21 22:49:01 2002
@@ -1770,8 +1770,11 @@
 	     so they are made live.  */
 	  for (i = 0; i < FIRST_PSEUDO_REGISTER; i++)
 	    if (global_regs[i])
-	      mark_used_reg (pbi, gen_rtx_REG (reg_raw_mode[i], i),
-			     cond, insn);
+	      {
+		SET_REGNO_REG_SET (pbi->reg_live, i);
+		mark_used_reg (pbi, gen_rtx_REG (reg_raw_mode[i], i),
+			       cond, insn);
+	      }
 	}
     }
 

>Release-Note:
>Audit-Trail:
>Unformatted:
 
 
 


             reply	other threads:[~2002-09-09 21:36 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-09-09 14:36 Richard Zidlicky [this message]
2002-12-14 12:56 Richard Zidlicky
2003-02-28  3:02 wilson
2003-02-28  3:26 Jim Wilson
2003-02-28  5:56 Richard Henderson
2003-02-28 16:46 Jim Wilson
2003-03-10  5:16 Jim Wilson
2003-04-02 20:56 Richard Zidlicky
2003-04-06 19:46 Jim Wilson
2003-05-01  6:06 Jim Wilson
2003-05-02 12:26 Richard Zidlicky
2003-05-02 14:16 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=200209092059.WAA05222@rz.de \
    --to=rz@linux-m68k.org \
    --cc=gcc-gnats@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).