I try to install gcc 4.1; I have $ svn info Path: . URL: svn://gcc.gnu.org/svn/gcc/branches/gcc-4_1-branch Repository UUID: 138bc75d-0d04-0410-961f-82ee72b054a4 Revision: 107570 Node Kind: directory Schedule: normal Last Changed Author: kargl Last Changed Rev: 107569 Last Changed Date: 2005-11-27 09:51:54 -0600 (Sun, 27 Nov 2005) Properties Last Updated: 2005-11-27 14:41:39 -0600 (Sun, 27 Nov 2005) I configured with $ CFLAGS='-g -O2 -mcpu=G4 -mabi=altivec -mlongcall' CXXFLAGS='-g -O2 -mcpu=G4 -mabi=altivec -mlongcall' FCFLAGS='-g -O2 -mcpu=G4 -mabi=altivec -mlongcall' /Users/eschnett/src/gcc-4.1/configure --prefix=/Users/eschnett/gcc --with-mpfr=/Users/eschnett --disable-multilib --enable-languages=c,c++,fortran,java,objc,treelang and a "make boostrap" results in ./xgcc -B./ -B/Users/eschnett/gcc/powerpc-apple-darwin8.3.0/bin/ -isystem /Users/eschnett/gcc/powerpc-apple-darwin8.3.0/include -isystem /Users/eschnett/gcc/powerpc-apple-darwin8.3.0/sys-include -L/Users/eschnett/src/gcc-build-4.1/gcc/../ld -O2 -O2 -g -O2 -mcpu=G4 -mabi=altivec -mlongcall -DIN_GCC -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition -isystem ./include -Wa,-force_cpusubtype_ALL -pipe -g -DHAVE_GTHR_DEFAULT -DIN_LIBGCC2 -D__GCC_FLOAT_NOT_NEEDED -I. -I. -I/Users/eschnett/src/gcc-4.1/gcc -I/Users/eschnett/src/gcc-4.1/gcc/. -I/Users/eschnett/src/gcc-4.1/gcc/../include -I./../intl -I/Users/eschnett/src/gcc-4.1/gcc/../libcpp/include -I/Users/eschnett/include -fexceptions -fvisibility=hidden -DHIDE_EXPORTS -c /Users/eschnett/src/gcc-4.1/gcc/unwind-dw2.c -o libgcc/./unwind-dw2.o /Users/eschnett/src/gcc-4.1/gcc/unwind.inc: In function ‘_Unwind_RaiseException’: /Users/eschnett/src/gcc-4.1/gcc/unwind.inc:140: internal compiler error: in rs6000_emit_prologue, at config/rs6000/rs6000.c:14039 Please submit a full bug report, with preprocessed source if appropriate. See <URL:http://gcc.gnu.org/bugs.html> for instructions. {standard input}:4874:non-relocatable subtraction expression, "L_abort$stub" minus "L550_pic" {standard input}:4874:symbol: "L_abort$stub" can't be undefined in a subtraction expression {standard input}:4872:non-relocatable subtraction expression, "L_abort$stub" minus "L550_pic" {standard input}:4872:symbol: "L_abort$stub" can't be undefined in a subtraction expression {standard input}:4602:non-relocatable subtraction expression, "L_abort$stub" minus "L517_pic" {standard input}:4602:symbol: "L_abort$stub" can't be undefined in a subtraction expression {standard input}:4600:non-relocatable subtraction expression, "L_abort$stub" minus "L517_pic" [some similar lines omitted] {standard input}:unknown:Undefined local symbol L_abort$stub {standard input}:unknown:Undefined local symbol L__Unwind_Find_FDE$stub {standard input}:unknown:Undefined local symbol L_memcpy$stub {standard input}:unknown:Undefined local symbol L_memset$stub {standard input}:unknown:Undefined local symbol L__Unwind_fallback_frame_state_for$stub {standard input}:unknown:Undefined local symbol L_strlen$stub {standard input}:unknown:Undefined local symbol L_pthread_once$stub make[3]: *** [libgcc/./unwind-dw2.o] Error 1 make[2]: *** [libgcc.a] Error 2 make[1]: *** [stage1_build] Error 2 make: *** [bootstrap] Error 2
Is there a reason why you are bootstrapping with -mlongcall?
In the end, I want to build some large applications, and I had an error at one time where one of gcc's run time libraries needed to be built with -mlongcall. I didn't investigate this more closely, and I could be wrong with that statement, so that some other change that I made made my application build successfully. I've been bootstrapping with -mlongcall for some time, and I didn't encounter any problems. I'm using Apple's gcc 3.3 for bootstrapping. I'm now re-running the bootstrap with the options "-mcpu=G4 -mabi=altivec" removed, and this seems to go fine (so far).
After removing the flags "-mcpu=G4 -mabi=altivec" from the explicit compiler options, the bootstrap completes fine.
Can you attach the preprocessed source for unwind-dw2.c when bootstrapping with options that ICE?
Created attachment 10351 [details] Failing preprocessed source code (gzipped)
(In reply to comment #0) > I try to install gcc 4.1; I have > > $ svn info > Path: . > URL: svn://gcc.gnu.org/svn/gcc/branches/gcc-4_1-branch > Repository UUID: 138bc75d-0d04-0410-961f-82ee72b054a4 > Revision: 107570 > Node Kind: directory > Schedule: normal > Last Changed Author: kargl > Last Changed Rev: 107569 > Last Changed Date: 2005-11-27 09:51:54 -0600 (Sun, 27 Nov 2005) > Properties Last Updated: 2005-11-27 14:41:39 -0600 (Sun, 27 Nov 2005) > > I configured with > > $ CFLAGS='-g -O2 -mcpu=G4 -mabi=altivec -mlongcall' CXXFLAGS='-g -O2 -mcpu=G4 > -mabi=altivec -mlongcall' FCFLAGS='-g -O2 -mcpu=G4 -mabi=altivec -mlongcall' > /Users/eschnett/src/gcc-4.1/configure --prefix=/Users/eschnett/gcc > --with-mpfr=/Users/eschnett --disable-multilib > --enable-languages=c,c++,fortran,java,objc,treelang > > and a "make boostrap" results in > > ./xgcc -B./ -B/Users/eschnett/gcc/powerpc-apple-darwin8.3.0/bin/ -isystem > /Users/eschnett/gcc/powerpc-apple-darwin8.3.0/include -isystem > /Users/eschnett/gcc/powerpc-apple-darwin8.3.0/sys-include > -L/Users/eschnett/src/gcc-build-4.1/gcc/../ld -O2 -O2 -g -O2 -mcpu=G4 > -mabi=altivec -mlongcall -DIN_GCC -W -Wall -Wwrite-strings > -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition -isystem > ./include -Wa,-force_cpusubtype_ALL -pipe -g -DHAVE_GTHR_DEFAULT -DIN_LIBGCC2 > -D__GCC_FLOAT_NOT_NEEDED -I. -I. -I/Users/eschnett/src/gcc-4.1/gcc > -I/Users/eschnett/src/gcc-4.1/gcc/. > -I/Users/eschnett/src/gcc-4.1/gcc/../include -I./../intl > -I/Users/eschnett/src/gcc-4.1/gcc/../libcpp/include -I/Users/eschnett/include > -fexceptions -fvisibility=hidden -DHIDE_EXPORTS -c > /Users/eschnett/src/gcc-4.1/gcc/unwind-dw2.c -o libgcc/./unwind-dw2.o > /Users/eschnett/src/gcc-4.1/gcc/unwind.inc: In function > ‘_Unwind_RaiseException’: > /Users/eschnett/src/gcc-4.1/gcc/unwind.inc:140: internal compiler error: in > rs6000_emit_prologue, at config/rs6000/rs6000.c:14039 > Please submit a full bug report, > with preprocessed source if appropriate. > See <URL:http://gcc.gnu.org/bugs.html> for instructions. > {standard input}:4874:non-relocatable subtraction expression, "L_abort$stub" > minus "L550_pic" > {standard input}:4874:symbol: "L_abort$stub" can't be undefined in a > subtraction expression > {standard input}:4872:non-relocatable subtraction expression, "L_abort$stub" > minus "L550_pic" > {standard input}:4872:symbol: "L_abort$stub" can't be undefined in a > subtraction expression > {standard input}:4602:non-relocatable subtraction expression, "L_abort$stub" > minus "L517_pic" > {standard input}:4602:symbol: "L_abort$stub" can't be undefined in a > subtraction expression > {standard input}:4600:non-relocatable subtraction expression, "L_abort$stub" > minus "L517_pic" > > [some similar lines omitted] > > {standard input}:unknown:Undefined local symbol L_abort$stub > {standard input}:unknown:Undefined local symbol L__Unwind_Find_FDE$stub > {standard input}:unknown:Undefined local symbol L_memcpy$stub > {standard input}:unknown:Undefined local symbol L_memset$stub > {standard input}:unknown:Undefined local symbol > L__Unwind_fallback_frame_state_for$stub > {standard input}:unknown:Undefined local symbol L_strlen$stub > {standard input}:unknown:Undefined local symbol L_pthread_once$stub > make[3]: *** [libgcc/./unwind-dw2.o] Error 1 > make[2]: *** [libgcc.a] Error 2 > make[1]: *** [stage1_build] Error 2 > make: *** [bootstrap] Error 2 > I had exactly the same bug when attempting to build gcc-4.0.1 and gcc-4.0.2 on Mac OSX 10.4.3 (Mac Mini, 512 MB memory). I used cd build ../gcc-4.0.2/configure --with-cpu=7450 --with-float=hard --disable-nls ... make bootstrap. Changing to ../gcc-4.0.2/configure --disable-nls appears to have solved the problem.
Reducing.
Reduced testcase: struct _Unwind_Context { void *ra; } init_dwarf_reg_size_table (void) { struct _Unwind_Context this_context, cur_context; __builtin_unwind_init (); long offset = uw_install_context_1 ((&this_context), (&cur_context)); void *handler = __builtin_frob_return_addr ((&cur_context)->ra); __builtin_eh_return (offset, handler); }
*** Bug 29310 has been marked as a duplicate of this bug. ***
Caused by: 2004-08-18 Fariborz Jahanian <fjahanian@apple.com> * config/rs6000/altivec.md: Add new patterns for calls to save_world/rest_world functions. * config/rs6000/rs6000-protos.h: (save_world_operation, restore_world_operation) new declarations. * config/rs6000/rs6000.c: (struct rs6000_stack) new world_save_p field added. (rs6000_stack_info): Set world_save_p field. (save_world_operation): New function. (restore_world_operation): New function. (compute_save_world_info): New function. (rs6000_stack_info): Call compute_save_world_info. (rs6000_emit_prologue): Check for world_save_p and generate pattern to call save_world for saving all non-volatile and special registers. (rs6000_emit_epilogue): Check for world_save_p and generate pattern to call rest_world to restore saved registers. config/rs6000/rs6000.h: macros FIRST_SAVED_ALTIVEC_REGNO, FIRST_SAVED_FP_REGNO, FIRST_SAVED_GP_REGNO defined. (rs6000_reg_names): New entries added for save_world_operation and restore_world_operation. Which makes this a regression.
This PR will not be fixed in GCC-4.0.4, so adjusting the milestone.
I'm working on this.
... at least, I think I have a patch which will fix it.
Subject: Bug 25127 Author: geoffk Date: Thu Jan 25 20:32:06 2007 New Revision: 121184 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=121184 Log: 2007-01-24 Geoffrey Keating <geoffk@apple.com> PR 25127 * config/rs6000/rs6000.c (first_altivec_reg_to_save): On Darwin, save Altivec registers in an eh_return function. (compute_vrsave_mask): Likewise. (rs6000_stack_info): Correct AIX/Darwin stack alignment computation for saving Altivec registers. (rs6000_emit_prologue): Don't allocate stack twice in eh_return function. Correct expected value of altivec_save_offset when using save_world. Describe save of R0 to stack when using save_world. Describe stack pointer adjustment when using save_world. Remove duplicated eh_return parameter register saving. Update sp_offset variable after save_world. * config/rs6000/t-darwin (LIB2FUNCS_STATIC_EXTRA): Remove darwin-world.asm. (LIB2FUNCS_EXTRA): Add darwin-world.asm. * config/rs6000/darwin.h (SUBTARGET_OVERRIDE_OPTIONS): -m64 implies Altivec. Index: gcc/testsuite/ChangeLog 2007-01-24 Geoffrey Keating <geoffk@apple.com> * gcc.target/powerpc/darwin-ehreturn-1.c: New. * g++.dg/eh/simd-2.C: Also run on Darwin. * g++.dg/eh/simd-3.C: New. * g++.dg/eh/simd-4.C: New. Added: trunk/gcc/testsuite/g++.dg/eh/simd-3.C trunk/gcc/testsuite/g++.dg/eh/simd-4.C trunk/gcc/testsuite/gcc.target/powerpc/darwin-ehreturn-1.c Modified: trunk/gcc/ChangeLog trunk/gcc/config/rs6000/darwin.h trunk/gcc/config/rs6000/rs6000.c trunk/gcc/config/rs6000/t-darwin trunk/gcc/testsuite/ChangeLog trunk/gcc/testsuite/g++.dg/eh/simd-2.C
Subject: Bug 25127 Author: geoffk Date: Fri Jan 26 00:03:28 2007 New Revision: 121190 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=121190 Log: 2007-01-24 Geoffrey Keating <geoffk@apple.com> PR 25127 * config/rs6000/rs6000.c (first_altivec_reg_to_save): On Darwin, save Altivec registers in an eh_return function. (compute_vrsave_mask): Likewise. (rs6000_stack_info): Correct AIX/Darwin stack alignment computation for saving Altivec registers. (rs6000_emit_prologue): Don't allocate stack twice in eh_return function. Correct expected value of altivec_save_offset when using save_world. Describe save of R0 to stack when using save_world. Describe stack pointer adjustment when using save_world. Remove duplicated eh_return parameter register saving. Update sp_offset variable after save_world. * config/rs6000/t-darwin (LIB2FUNCS_STATIC_EXTRA): Remove darwin-world.asm. (LIB2FUNCS_EXTRA): Add darwin-world.asm. * config/rs6000/darwin.h (SUBTARGET_OVERRIDE_OPTIONS): -m64 implies Altivec. Index: gcc/testsuite/ChangeLog 2007-01-24 Geoffrey Keating <geoffk@apple.com> * gcc.target/powerpc/darwin-ehreturn-1.c: New. * g++.dg/eh/simd-2.C: Also run on Darwin. * g++.dg/eh/simd-3.C: New. * g++.dg/eh/simd-4.C: New. Added: branches/gcc-4_2-branch/gcc/testsuite/g++.dg/eh/simd-3.C - copied unchanged from r121184, trunk/gcc/testsuite/g++.dg/eh/simd-3.C branches/gcc-4_2-branch/gcc/testsuite/g++.dg/eh/simd-4.C - copied unchanged from r121184, trunk/gcc/testsuite/g++.dg/eh/simd-4.C branches/gcc-4_2-branch/gcc/testsuite/gcc.target/powerpc/darwin-ehreturn-1.c - copied unchanged from r121184, trunk/gcc/testsuite/gcc.target/powerpc/darwin-ehreturn-1.c Modified: branches/gcc-4_2-branch/gcc/ChangeLog branches/gcc-4_2-branch/gcc/config/rs6000/darwin.h branches/gcc-4_2-branch/gcc/config/rs6000/rs6000.c branches/gcc-4_2-branch/gcc/config/rs6000/t-darwin branches/gcc-4_2-branch/gcc/testsuite/ChangeLog branches/gcc-4_2-branch/gcc/testsuite/g++.dg/eh/simd-2.C
This should be fixed now in the trunk and 4.2 branches.
Fixed since 4.2.0, wontfix on earlier branches.