This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re:other/8403: ICE in gcc/testsuite/gcc.c-torture/execute/20010122-1.c for sh-elf target
- From: "Naveen Sharma, Noida" <naveens at noida dot hcltech dot com>
- To: gcc-gnats at gcc dot gnu dot org, gcc-prs at gcc dot gnu dot org, gcc-bugs at gcc dot gnu dot org
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Thu, 19 Dec 2002 12:24:31 +0530
- Subject: Re:other/8403: ICE in gcc/testsuite/gcc.c-torture/execute/20010122-1.c for sh-elf target
Hi,
This fixes PR 8403.
The fix is pretty obvious.
The function has_hard_reg_initial_val can return a MEM rtx too depending
on definition of ALLOCATE_INITIAL_VALUE macro. So the patch just checks
if it is REG before using REGNO macro.
Incidently this also fixes bootstrap error(while building libgcc)
on mainline for sh-elf cross when rtl checking is enabled.
Tested for sh-elf-target.
Best Regards,
Naveen Sharma.
Index: gcc/ChangeLog
===================================================================
RCS file: /cvsroot/gcc/gcc/gcc/ChangeLog,v
retrieving revision 1.16136
diff -c -2 -p -r1.16136 ChangeLog
*** gcc/ChangeLog 18 Dec 2002 06:36:45 -0000 1.16136
--- gcc/ChangeLog 19 Dec 2002 06:36:34 -0000
***************
*** 1,2 ****
--- 1,7 ----
+ 2002-12-19 Naveen Sharma <naveens@noida.hcltech.com>
+
+ * config/sh/sh.c (calc_live_regs): Check return code of
+ has_hard_reg_initial_val for REG before using the REGNO macro.
+
2002-12-17 Jason Merrill <jason@redhat.com>
Index: gcc/config/sh/sh.c
===================================================================
RCS file: /cvsroot/gcc/gcc/gcc/config/sh/sh.c,v
retrieving revision 1.189
diff -c -2 -p -r1.189 sh.c
*** gcc/config/sh/sh.c 16 Dec 2002 18:21:54 -0000 1.189
--- gcc/config/sh/sh.c 19 Dec 2002 06:36:52 -0000
*************** calc_live_regs (count_ptr, live_regs_mas
*** 4421,4426 ****
{
rtx pr_initial = has_hard_reg_initial_val (Pmode, PR_REG);
! pr_live = (pr_initial
! ? REGNO (pr_initial) != (PR_REG) : regs_ever_live[PR_REG]);
}
/* Force PR to be live if the prologue has to call the SHmedia
--- 4421,4426 ----
{
rtx pr_initial = has_hard_reg_initial_val (Pmode, PR_REG);
! pr_live = (pr_initial && GET_CODE (pr_initial) == REG)
! ? REGNO (pr_initial) != (PR_REG) : regs_ever_live[PR_REG];
}
/* Force PR to be live if the prologue has to call the SHmedia