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.
from the point of view of powerpc-darwin, this is the right fix (it doesn't need to act on FIELD in this context).
darwin should simply add a dummy use of field, like via ((field), (...))
(In reply to Richard Biener from comment #2) > darwin should simply add a dummy use of field, like via ((field), (...)) well, I thought of doing that, but it seems a kludge - is the target obliged to use the macro values?
(In reply to Iain Sandoe from comment #3) > (In reply to Richard Biener from comment #2) > > darwin should simply add a dummy use of field, like via ((field), (...)) > > well, I thought of doing that, but it seems a kludge - is the target obliged > to use the macro values? Given that all other targets use it, I'd say yes in this case.
Also, ppc*-darwin* isn't primary nor secondary target and the only one affected, downgrading to P4.
Patch posted at http://gcc.gnu.org/ml/gcc-patches/2014-01/msg00816.html.
Author: iains Date: Mon Jan 20 11:20:24 2014 New Revision: 206802 URL: http://gcc.gnu.org/viewcvs?rev=206802&root=gcc&view=rev Log: gcc: PR bootstrap/59496 * config/rs6000/darwin.h (ADJUST_FIELD_ALIGN): Fix unused variable warning. Amend comment to reflect current functionality. Modified: trunk/gcc/ChangeLog trunk/gcc/config/rs6000/darwin.h
Thanks for the fix. Closing.