failing to copy NOTEs

Alexandre Oliva oliva@lsd.ic.unicamp.br
Fri Jan 28 01:18:00 GMT 2000


On Jan 26, 2000, Alexandre Oliva <oliva@lsd.ic.unicamp.br> 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  <rth@cygnus.com>

	* 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);
       NOTE_LINE_NUMBER (insn) = NOTE_INSN_DELETED_LABEL;

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



More information about the Gcc-patches mailing list