[Bug bootstrap/52058] New: [4.7 regression] bootstrap fails on HAVE_cc0: combine.c: 'do_SUBST_LINK' defined but not used

mikpe at it dot uu.se gcc-bugzilla@gcc.gnu.org
Mon Jan 30 20:55:00 GMT 2012


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52058

             Bug #: 52058
           Summary: [4.7 regression] bootstrap fails on HAVE_cc0:
                    combine.c: 'do_SUBST_LINK' defined but not used
    Classification: Unclassified
           Product: gcc
           Version: 4.7.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: bootstrap
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: mikpe@it.uu.se


Attempting to bootstrap gcc-4.7-20120128 on a HAVE_cc0 machine like m68k-linux
fails in stage 2 with:

/mnt/scratch/objdir47/./prev-gcc/xgcc -B/mnt/scratch/objdir47/./prev-gcc/
-B/mnt/scratch/install47/m68k-unknown-linux-gnu/bin/
-B/mnt/scratch/install47/m68k-unknown-linux-gnu/bin/
-B/mnt/scratch/install47/m68k-unknown-linux-gnu/lib/ -isystem
/mnt/scratch/install47/m68k-unknown-linux-gnu/include -isystem
/mnt/scratch/install47/m68k-unknown-linux-gnu/sys-include    -c   -g -O2
-gtoggle -DIN_GCC   -W -Wall -Wno-narrowing -Wwrite-strings -Wcast-qual
-Wstrict-prototypes -Wmissing-prototypes -Wmissing-format-attribute -pedantic
-Wno-long-long -Wno-variadic-macros -Wno-overlength-strings -Werror
-Wold-style-definition -Wc++-compat   -DHAVE_CONFIG_H -I. -I.
-I/mnt/scratch/gcc-4.7-20120128/gcc -I/mnt/scratch/gcc-4.7-20120128/gcc/.
-I/mnt/scratch/gcc-4.7-20120128/gcc/../include
-I/mnt/scratch/gcc-4.7-20120128/gcc/../libcpp/include
-I/home/mikpe/pkgs/linux-m68k/gmp-5.0.2/include
-I/home/mikpe/pkgs/linux-m68k/mpfr-3.1.0/include
-I/home/mikpe/pkgs/linux-m68k/mpc-0.9/include 
-I/mnt/scratch/gcc-4.7-20120128/gcc/../libdecnumber
-I/mnt/scratch/gcc-4.7-20120128/gcc/../libdecnumber/dpd -I../libdecnumber   
/mnt/scratch/gcc-4.7-20120128/gcc/combine.c -o combine.o
/mnt/scratch/gcc-4.7-20120128/gcc/combine.c:796:1: error: 'do_SUBST_LINK'
defined but not used [-Werror=unused-function]
cc1: all warnings being treated as errors

make[3]: *** [combine.o] Error 1
make[3]: Leaving directory `/mnt/scratch/objdir47/gcc'
make[2]: *** [all-stage2-gcc] Error 2
make[2]: Leaving directory `/mnt/scratch/objdir47'
make[1]: *** [stage2-bubble] Error 2
make[1]: Leaving directory `/mnt/scratch/objdir47'
make: *** [bootstrap] Error 2

This is because the PR rtl-optimization/48308 fix in r183512 added an
unconditional definition of do_SUBST_LINK, but it's used #ifndef HAVE_cc0.

The definition could also be made #ifndef HAVE_cc0, but a cleaner solution
perhaps is to mark it ATTRIBUTE_UNUSED:

--- gcc-4.7-20120128/gcc/combine.c.~1~  2012-01-25 09:52:39.000000000 +0100
+++ gcc-4.7-20120128/gcc/combine.c      2012-01-30 20:57:54.000000000 +0100
@@ -792,7 +792,7 @@ do_SUBST_MODE (rtx *into, enum machine_m

 /* Similar to SUBST, but NEWVAL is a LOG_LINKS expression.  */

-static void
+static void ATTRIBUTE_UNUSED
 do_SUBST_LINK (struct insn_link **into, struct insn_link *newval)
 {
   struct undo *buf;

With this fix my bootstrap does get past stage 2 combine.c.



More information about the Gcc-bugs mailing list