On Linux/x86-64, when configured with --with-multilib-list=m32,m64,mx32, r214699 failed to bootstrap: In file included from ../../../../src-trunk/libgcc/config/libbid/bid_internal.h:27:0, from ../../../../src-trunk/libgcc/config/libbid/bid_round.c:108: ../../../../src-trunk/libgcc/config/libbid/bid_round.c: In function â__bid_round64_2_18â: ../../../../src-trunk/libgcc/config/libbid/bid_conf.h:48:22: internal compiler error: in as_a, at is-a.h:192 #define round64_2_18 __bid_round64_2_18 ^ ../../../../src-trunk/libgcc/config/libbid/bid_round.c:111:1: note: in expansion of macro âround64_2_18â round64_2_18 (int q, ^ 0x781642 rtx_insn* as_a<rtx_insn*, rtx_def>(rtx_def*) ../../src-trunk/gcc/is-a.h:192 0x90b93c assign_parm_setup_reg ../../src-trunk/gcc/function.c:3044 0x90d763 assign_parms ../../src-trunk/gcc/function.c:3453 0x9117cf expand_function_start(tree_node*) ../../src-trunk/gcc/function.c:4809 0x760cd9 execute ../../src-trunk/gcc/cfgexpand.c:5715 Please submit a full bug report, with preprocessed source if appropriate. Please include the complete backtrace with any bug report. See <http://gcc.gnu.org/bugs.html> for instructions. make[8]: *** [bid_round.o] Error 1 make[8]: *** Waiting for unfinished jobs.... ../../../../src-trunk/libgcc/config/libbid/bid128_fma.c: In function ârounding_correction.constpropâ: ../../../../src-trunk/libgcc/config/libbid/bid128_fma.c:33:1: internal compiler error: in as_a, at is-a.h:192 rounding_correction (unsigned int rnd_mode, ^ 0x781642 rtx_insn* as_a<rtx_insn*, rtx_def>(rtx_def*) ../../src-trunk/gcc/is-a.h:192 0x90b93c assign_parm_setup_reg ../../src-trunk/gcc/function.c:3044 0x90d763 assign_parms ../../src-trunk/gcc/function.c:3453 0x9117cf expand_function_start(tree_node*) ../../src-trunk/gcc/function.c:4809 0x760cd9 execute ../../src-trunk/gcc/cfgexpand.c:5715 Please submit a full bug report, with preprocessed source if appropriate. Please include the complete backtrace with any bug report. See <http://gcc.gnu.org/bugs.html> for instructions. make[8]: *** [bid128_fma.o] Error 1 make[8]: Leaving directory `/export/gnu/import/git/gcc-test-x32/bld/x86_64-unknown-linux-gnu/x32/libgcc' make[7]: *** [multi-do] Error 1 make[7]: Leaving directory `/export/gnu/import/git/gcc-test-x32/bld/x86_64-unknown-linux-gnu/libgcc' make[6]: *** [all-multi] Error 2 make[6]: Leaving directory `/export/gnu/import/git/gcc-test-x32/bld/x86_64-unknown-linux-gnu/libgcc' make[5]: *** [all-stage1-target-libgcc] Error 2 make[5]: Leaving directory `/export/gnu/import/git/gcc-test-x32/bld' make[4]: *** [stage1-bubble] Error 2 make[4]: Leaving directory `/export/gnu/import/git/gcc-test-x32/bld' make[3]: *** [bootstrap] Error 2
Created attachment 33413 [details] A testcase [x32@gnu-35 gcc]$ ./xgcc -B./ -S -fPIC -O2 /tmp/x.i -mx32 ../../../../src-trunk/libgcc/config/libbid/bid128_fma.c: In function ‘rounding_correction.constprop’: ../../../../src-trunk/libgcc/config/libbid/bid128_fma.c:33:1: internal compiler error: in as_a, at is-a.h:192 0x781642 rtx_insn* as_a<rtx_insn*, rtx_def>(rtx_def*) ../../src-trunk/gcc/is-a.h:192 0x90b93c assign_parm_setup_reg ../../src-trunk/gcc/function.c:3044 0x90d763 assign_parms ../../src-trunk/gcc/function.c:3453 0x9117cf expand_function_start(tree_node*) ../../src-trunk/gcc/function.c:4809 0x760cd9 execute ../../src-trunk/gcc/cfgexpand.c:5715 Please submit a full bug report, with preprocessed source if appropriate. Please include the complete backtrace with any bug report. See <http://gcc.gnu.org/bugs.html> for instructions.
r214689 is OK.
Created attachment 33414 [details] Candidate fix, only lightly tested so far
Sorry about this. The issue is here: 3042 insn = as_a <rtx_insn *> ( 3043 gen_extend_insn (op0, t, promoted_nominal_mode, 3044 data->passed_mode, unsignedp)); which I mistakenly introduced in r214698. The result of the gen_extend_insn is a SET, not an insn: (set (reg/v:DI 151 [ ptrres ]) (zero_extend:DI (mem/f/c:SI (reg/f:SI 77 virtual-incoming-args) [8 ptrres+0 S4 A64]))) hence the as_a <rtx_insn *> fails. Am attaching a patch which appears to fix it.
Author: dmalcolm Date: Fri Aug 29 03:12:01 2014 New Revision: 214714 URL: https://gcc.gnu.org/viewcvs?rev=214714&root=gcc&view=rev Log: PR bootstrap/62300 * function.c (assign_parm_setup_reg): Remove erroneous checked cast to rtx_insn * on result of gen_extend_insn in favor of introducing a new local rtx "pat". Modified: trunk/gcc/ChangeLog trunk/gcc/function.c
Fix committed as r214714.
Fixed.