failing to copy NOTEs

Alexandre Oliva
Fri Jan 28 01:18:00 GMT 2000

On Jan 26, 2000, Alexandre Oliva <> wrote:

> 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

Actually, it was a NOTE_INSN_DELETED_LABEL.

> Note that it only fails with -O2 -finline-functions and -Wall
> (-Wunused is not enough; can anybody explain why?)

It was -Wreturn-init that triggered the problem.  (Thanks to
Martin Bucholtz for the bug report that hinted me to it!)  It would
enable a jump optimization pass with optimization=0 before
saving the function for inline.  However, because of:

2000-01-19  Richard Henderson  <>

	* jump.c [...]
	(delete_insn): Patch out insns even when not optimizing.

diff -u -p -r1.98 -r1.99
--- jump.c      2000/01/17 15:28:05     1.98
+++ jump.c      2000/01/19 09:42:10     1.99
@@ -4320,8 +4302,7 @@ delete_insn (insn)

   /* Don't delete user-declared labels.  Convert them to special NOTEs
      instead.  */
-  if (was_code_label && LABEL_NAME (insn) != 0
-      && optimize && ! dont_really_delete)
+  if (was_code_label && LABEL_NAME (insn) != 0 && ! dont_really_delete)
       PUT_CODE (insn, NOTE);

It would not just mark the unused label:

(code_label 8 3 10 3 ("skip_it") "" [num uses: 0])

as deleted, it would turn it into a NOTE_INSN_DELETED_LABEL, that
copy_rtx_and_substitute() and subst_constants() couldn't deal with.

I'm not sure whether we should install the patch I posted on Wednesday
or revert this hunk of the stupid.c-die-die-die! patch.  Richard?

Alexandre Oliva IC-Unicamp, Bra[sz]il
oliva@{,guarana.{org,com}} aoliva@{acm,computer}.org
** I may forward mail about projects to mailing lists; please use them

More information about the Gcc-patches mailing list