From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 3787 invoked by alias); 9 Sep 2002 21:36:01 -0000 Mailing-List: contact gcc-prs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-prs-owner@gcc.gnu.org Received: (qmail 3757 invoked by uid 71); 9 Sep 2002 21:36:00 -0000 Resent-Date: 9 Sep 2002 21:36:00 -0000 Resent-Message-ID: <20020909213600.3756.qmail@sources.redhat.com> Resent-From: gcc-gnats@gcc.gnu.org (GNATS Filer) Resent-Cc: gcc-prs@gcc.gnu.org, gcc-bugs@gcc.gnu.org Resent-Reply-To: gcc-gnats@gcc.gnu.org, Richard Zidlicky Received: (qmail 3313 invoked from network); 9 Sep 2002 21:34:27 -0000 Received: from unknown (HELO faui02.informatik.uni-erlangen.de) (131.188.30.102) by sources.redhat.com with SMTP; 9 Sep 2002 21:34:27 -0000 Received: from rz.de (root@faui02g.informatik.uni-erlangen.de [131.188.30.156]) by faui02.informatik.uni-erlangen.de (8.12.6/8.12.6) with ESMTP id g89LY7ix015996 for ; Mon, 9 Sep 2002 23:34:23 +0200 (MEST) Received: (from rz@localhost) by rz.de (8.8.8/8.8.8) id WAA05222; Mon, 9 Sep 2002 22:59:09 +0200 Message-Id: <200209092059.WAA05222@rz.de> Date: Mon, 09 Sep 2002 14:36:00 -0000 From: Richard Zidlicky To: gcc-gnats@gcc.gnu.org X-Send-Pr-Version: 3.113 Subject: c/7871: ICE on legal code, global register variables problems X-SW-Source: 2002-09/txt/msg00159.txt.bz2 List-Id: >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 for instructions. .file "x4m68k.i" >How-To-Repeat: # 1 "x4.c" # 1 "" # 1 "" # 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: