This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
failing to copy NOTEs
- To: gcc-patches at gcc dot gnu dot org
- Subject: failing to copy NOTEs
- From: Alexandre Oliva <oliva at lsd dot ic dot unicamp dot br>
- Date: 26 Jan 2000 03:30:44 -0200
For some reason, that I'm still investigating and that was introduced
after gcc_ss_20000117, copy_rtx_and_substitute() is now being asked to
copy a sequence of insns containing a NOTE_DELETED, and it fails to do
so because it can't deal with notes. The minimal testcase that
triggers the problem is included in the patch below. Note that it
only fails with -O2 -finline-functions and -Wall (-Wunused is not
enough; can anybody explain why?) Ok to install?
Index: gcc/ChangeLog
from Alexandre Oliva <oliva@lsd.ic.unicamp.br>
* integrate.c (copy_rtx_and_substitute): Copy NOTEs.
(subst_constants): Ignore them.
Index: gcc/integrate.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/integrate.c,v
retrieving revision 1.88
diff -u -r1.88 integrate.c
--- gcc/integrate.c 2000/01/19 09:42:10 1.88
+++ gcc/integrate.c 2000/01/26 05:24:02
@@ -2036,6 +2036,7 @@
XWINT (copy, i) = XWINT (orig, i);
break;
+ case 'n':
case 'i':
XINT (copy, i) = XINT (orig, i);
break;
@@ -2326,6 +2327,7 @@
subst_constants (&XEXP (x, i), insn, map, memonly);
break;
+ case 'n':
case 'u':
case 'i':
case 's':
Index: gcc/testsuite/ChangeLog
from Alexandre Oliva <oliva@lsd.ic.unicamp.br>
* gcc.dg/unused-2.c: New test.
Index: gcc/testsuite/gcc.dg/unused-2.c
===================================================================
RCS file: unused-2.c
diff -N unused-2.c
--- gcc/testsuite/gcc.dg/unused-2.c Tue May 5 13:32:27 1998
+++ gcc/testsuite/gcc.dg/unused-2.c Tue Jan 25 21:24:03 2000
@@ -0,0 +1,19 @@
+/* Copyright (C) 2000 Free Software Foundation.
+
+ by Alexandre Oliva <oliva@lsd.ic.unicamp.br> */
+
+/* { dg-do compile } */
+/* { dg-options "-O2 -finline-functions -Wall" } */
+
+static void
+foo ()
+{
+ skip_it: /* { dg-warning "unused label" "unused label warning" } */
+ ;
+}
+
+void
+bar ()
+{
+ foo ();
+}
--
Alexandre Oliva http://www.ic.unicamp.br/~oliva IC-Unicamp, Bra[sz]il
oliva@{lsd.ic.unicamp.br,guarana.{org,com}} aoliva@{acm,computer}.org
oliva@{gnu.org,kaffe.org,{egcs,sourceware}.cygnus.com,samba.org}
** I may forward mail about projects to mailing lists; please use them