PATCH: Missing return_label using g++ CVS under vax ultrix.

John David Anglin dave@hiauly1.hia.nrc.ca
Wed Nov 29 10:14:00 GMT 2000


The following error occurs building libio (v2) under vax ultrix:

/xxx/gnu/gcc-2.97/objdir/gcc/g++ -B/xxx/gnu/gcc-2.97/objdir/gcc/ -nostdinc++ -isystem /xxx/gnu/gcc-2.97/libstdc++ -isystem /xxx/gnu/gcc-2.97/libstdc++/std -isystem /xxx/gnu/gcc-2.97/libstdc++/stl -isystem /xxx/gnu/gcc-2.97/libio -isystem /xxx/gnu/gcc-2.97/objdir/vax-dec-ultrix4.3/libio -L/xxx/gnu/gcc-2.97/objdir/vax-dec-ultrix4.3/libstdc++ -B/usr/local/vax-dec-ultrix4.3/bin/ -B/usr/local/vax-dec-ultrix4.3/lib/ -isystem /usr/local/vax-dec-ultrix4.3/include -c -O3 -fno-implicit-templates -I. -I../../../libio -nostdinc++  ../../../libio/filebuf.cc
_G_config.h:85: warning: badly nested C headers from preprocessor
../../../libio/libioP.h:29: warning: badly nested C headers from preprocessor
../../../libio/filebuf.cc:27: warning: badly nested C headers from preprocessor
../../../libio/filebuf.cc:28: warning: badly nested C headers from preprocessor
../../../libio/filebuf.cc:29: warning: badly nested C headers from preprocessor
../../../libio/filebuf.cc:30: warning: badly nested C headers from preprocessor
../../../libio/filebuf.cc: In member function `void filebuf::init()':
../../../libio/filebuf.cc:223: Internal compiler error in mark_jump_label, at 
   jump.c:2423
   Please submit a full bug report.
   See <URL: http://www.gnu.org/software/gcc/bugs.html > for instructions.
make[2]: *** [filebuf.o] Error 1
make[2]: Leaving directory `/xxx/gnu/gcc-2.97/objdir/vax-dec-ultrix4.3/libio'
make[1]: *** [all-target-libio] Error 2
make[1]: Leaving directory `/xxx/gnu/gcc-2.97/objdir'
make: *** [bootstrap2] Error 2
Tue Nov 28 11:40:12 EST 2000

After analyzing this, the following small test program demonstrates the
problem:

extern "C" {
  extern void IO_init (void);
}

void f ()
{
  IO_init ();
}

The initial rtl generated is:

;; Function void f()

(note 2 0 5 NOTE_INSN_DELETED -1347440721)

(note 5 2 14 NOTE_INSN_FUNCTION_BEG -1347440721)

(call_insn 14 5 15 (parallel[ 
            (call (mem:QI (symbol_ref:SI ("IO_init")) 0)
                (const_int 0 [0x0]))
            (set (reg:SI 14 sp)
                (plus:SI (reg:SI 14 sp)
                    (const_int 0 [0x0])))
        ] ) -1 (nil)
    (nil)
    (nil))

(jump_insn 15 14 16 (set (pc)
        (label_ref 0)) -1 (nil)
    (nil))

(barrier 16 15 17)

(note 17 16 19 NOTE_INSN_FUNCTION_END -1347440721)

(jump_insn 19 17 20 (return) -1 (nil)
    (nil))

(barrier 20 19 0)

As can be seen, jump_insn 15 has no label.  The enclosed patch ensures
that we have a label to jump to.  The patch allows libio to build
successfully.  However, another g++ problem occurs building libstdc++.
I also don't know why the warnings about incorrectly nested headers
are occuring with g++.  I couldn't see an obvious reason for them in
the cpp processed output.  The CVS source is from Nov. 10.

Please review the patch and install if ok.

Dave
-- 
J. David Anglin                                  dave.anglin@nrc.ca
National Research Council of Canada              (613) 990-0752 (FAX: 952-6605)

2000-11-28  John David Anglin  <dave@hiauly1.hia.nrc.ca>

	* semantics.c (genrtl_finish_function): Ensure that there is a
	return_label to jump to.

--- semantics.c.orig	Fri Oct  6 23:32:51 2000
+++ semantics.c	Tue Nov 28 22:06:12 2000
@@ -2601,6 +2601,8 @@
 
   /* Finish building code that will trigger warnings if users forget
      to make their functions return values.  */
+  if (!return_label)
+    return_label = gen_label_rtx ();
   emit_jump (return_label);
   if (no_return_label)
     {


More information about the Gcc-patches mailing list