This is the mail archive of the gcc-prs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

c/7871: ICE on legal code, global register variables problems


>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:
 
 
 


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]