http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59496
Bug ID: 59496 Summary: [4.9 Regression] Bootstrap fails on powerpc-apple-darwin9 after r205685 Product: gcc Version: 4.9.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: bootstrap Assignee: unassigned at gcc dot gnu.org Reporter: dominiq at lps dot ens.fr CC: iains at gcc dot gnu.org, jsm28 at gcc dot gnu.org, mpolacek at gcc dot gnu.org Host: powerpc-apple-darwin9 Target: powerpc-apple-darwin9 Build: powerpc-apple-darwin9 Bootstrap fails on powerpc-apple-darwin9 after r205685 and is not fixed by r205705: /opt/gcc/rel_build/./prev-gcc/xg++ -B/opt/gcc/rel_build/./prev-gcc/ -B/opt/gcc/gcc4.9r/powerpc-apple-darwin9.8.0/bin/ -nostdinc++ -B/opt/gcc/rel_build/prev-powerpc-apple-darwin9.8.0/libstdc++-v3/src/.libs -B/opt/gcc/rel_build/prev-powerpc-apple-darwin9.8.0/libstdc++-v3/libsupc++/.libs -I/opt/gcc/rel_build/prev-powerpc-apple-darwin9.8.0/libstdc++-v3/include/powerpc-apple-darwin9.8.0 -I/opt/gcc/rel_build/prev-powerpc-apple-darwin9.8.0/libstdc++-v3/include -I/opt/gcc/rel_work/libstdc++-v3/libsupc++ -L/opt/gcc/rel_build/prev-powerpc-apple-darwin9.8.0/libstdc++-v3/src/.libs -L/opt/gcc/rel_build/prev-powerpc-apple-darwin9.8.0/libstdc++-v3/libsupc++/.libs -c -DIN_GCC_FRONTEND -DIN_GCC_FRONTEND -g -O2 -mdynamic-no-pic -gtoggle -DIN_GCC -fno-exceptions -fno-rtti -fasynchronous-unwind-tables -W -Wall -Wno-narrowing -Wwrite-strings -Wcast-qual -Wmissing-format-attribute -pedantic -Wno-long-long -Wno-variadic-macros -Wno-overlength-strings -Werror -DHAVE_CONFIG_H -I. -Ic-family -I../../rel_work/gcc -I../../rel_work/gcc/c-family -I../../rel_work/gcc/../include -I./../intl -I../../rel_work/gcc/../libcpp/include -I/opt/mp/include -I../../rel_work/gcc/../libdecnumber -I../../rel_work/gcc/../libdecnumber/dpd -I../libdecnumber -I../../rel_work/gcc/../libbacktrace -DCLOOG_INT_GMP -I/opt/mp/include -o c-family/c-common.o -MT c-family/c-common.o -MMD -MP -MF c-family/.deps/c-common.TPo ../../rel_work/gcc/c-family/c-common.c ../../rel_work/gcc/c-family/c-common.c: In function 'tree_node* c_sizeof_or_alignof_type(location_t, tree, bool, bool, int)': ../../rel_work/gcc/c-family/c-common.c:5009:9: error: unused variable 'field' [-Werror=unused-variable] tree field = build_decl (UNKNOWN_LOCATION, FIELD_DECL, NULL_TREE, ^ cc1plus: all warnings being treated as errors The problem comes from the fact that ADJUST_FIELD_ALIGN is defined in gcc/config/rs6000/darwin.h as #define ADJUST_FIELD_ALIGN(FIELD, COMPUTED) \ (TARGET_ALIGN_NATURAL ? (COMPUTED) \ : (COMPUTED) == 128 ? 128 \ : MIN ((COMPUTED), 32)) and does not use FIELD, as seen in the preprocessed file ... tree field = build_decl_stat (((source_location) 0), FIELD_DECL, (tree) __null, type ) ; field_align = ((global_options.x_rs6000_alignment_flags & 0x00000001) ? (field_align) : (field_align) == 128 ? 128 : (((field_align)) < (32) ? ((field_align)) : (32))); align = ((align) < (field_align) ? (align) : (field_align)); ... I have fixed the problem with the following patch: --- gcc/c-family/c-common.c 2013-12-11 13:43:47.000000000 +0100 +++ ../work/gcc/c-family/c-common.c 2013-12-08 00:14:27.000000000 +0100 @@ -5002,7 +5006,7 @@ c_sizeof_or_alignof_type (location_t loc #endif unsigned int field_align = align; #ifdef ADJUST_FIELD_ALIGN - tree field = build_decl (UNKNOWN_LOCATION, FIELD_DECL, NULL_TREE, + tree __attribute__((unused)) field = build_decl (UNKNOWN_LOCATION, FIELD_DECL, NULL_TREE, type); field_align = ADJUST_FIELD_ALIGN (field, field_align); #endif Yes I know, the line is too long and patches should go to gcc-patches. I'll do it if there is a consensus that it is the right fix.