Bug 50836 - [4.7 regression] bootstrap fails due to error: no previous prototype for 'find_all_hard_reg_sets'
Summary: [4.7 regression] bootstrap fails due to error: no previous prototype for 'fin...
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: bootstrap (show other bugs)
Version: 4.7.0
: P3 normal
Target Milestone: 4.7.0
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-10-23 11:09 UTC by Mikael Pettersson
Modified: 2011-10-24 13:07 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Mikael Pettersson 2011-10-23 11:09:11 UTC
gcc-4.7-20111022 failed to bootstrap on i686-linux for me due to:

/mnt/scratch/objdir47/./prev-gcc/xgcc -B/mnt/scratch/objdir47/./prev-gcc/ -B/mnt/scratch/install47/i686-pc-linux-gnu/bin/ -B/mnt/scratch/install47/i686-pc-linux-gnu/bin/ -B/mnt/scratch/install47/i686-pc-linux-gnu/lib/ -isystem /mnt/scratch/install47/i686-pc-linux-gnu/include -isystem /mnt/scratch/install47/i686-pc-linux-gnu/sys-include    -c   -g -O2 -gtoggle -DIN_GCC   -W -Wall -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-20111022/gcc -I/mnt/scratch/gcc-4.7-20111022/gcc/. -I/mnt/scratch/gcc-4.7-20111022/gcc/../include -I/mnt/scratch/gcc-4.7-20111022/gcc/../libcpp/include -I/home/mikpe/pkgs/linux-x86/gmp-5.0.2/include -I/home/mikpe/pkgs/linux-x86/mpfr-3.0.1/include -I/home/mikpe/pkgs/linux-x86/mpc-0.9/include  -I/mnt/scratch/gcc-4.7-20111022/gcc/../libdecnumber -I/mnt/scratch/gcc-4.7-20111022/gcc/../libdecnumber/bid -I../libdecnumber    /mnt/scratch/gcc-4.7-20111022/gcc/rtlanal.c -o rtlanal.o
/mnt/scratch/gcc-4.7-20111022/gcc/rtlanal.c:1017:1: error: no previous prototype for 'find_all_hard_reg_sets' [-Werror=missing-prototypes]
cc1: all warnings being treated as errors

make[3]: *** [rtlanal.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

gcc-4.7-20111015 built Ok on that machine.

Configured as:
/mnt/scratch/gcc-4.7-20111022/configure --prefix=/mnt/scratch/install47 --with-gmp=/home/mikpe/pkgs/linux-x86/gmp-5.0.2 --with-mpfr=/home/mikpe/pkgs/linux-x86/mpfr-3.0.1 --with-mpc=/home/mikpe/pkgs/linux-x86/mpc-0.9 --disable-plugin --disable-lto --disable-nls --enable-threads=posix --enable-checking=release --disable-libmudflap --enable-languages=c,c++,objc,obj-c++,java,fortran,ada --disable-build-poststage1-with-cxx
Comment 1 Mikael Pettersson 2011-10-23 12:34:09 UTC
The same error also occurs on sparc64-linux and arm-linux-gnueabi.  It's caused by r180302:
http://gcc.gnu.org/ml/gcc-cvs/2011-10/msg00898.html

find_all_hard_reg_sets does have a prototype in rtl.h, but it's conditional on #ifdef HARD_CONST.  Deleting the #ifdef causes build errors, but changing the include order in rtlanal.c so that hard-reg-set.h is included before rtl.h solves the bootstrap problem.
Comment 2 Bernd Schmidt 2011-10-24 11:03:16 UTC
Author: bernds
Date: Mon Oct 24 11:03:12 2011
New Revision: 180376

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=180376
Log:
	PR bootstrap/50836
	* rtlanal.c: Swap includes of "hard-reg-set.h" and "rtl.h".

Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/rtlanal.c
Comment 3 Mikael Pettersson 2011-10-24 13:07:25 UTC
Fixed.

To clarify, the problem occured because the C and C++ front-ends differ with regard to -Wmissing-prototypes (the C++ FE doesn't have it).  People building stage2/3 in C++ mode won't see the error (but will see a warning in stage1), but people building in proper C mode (--disable-build-poststage1-with-cxx) will see the error.