This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: [3.0, c++, java]: -fomit-frame-pointer IS broken on x86!


On 27 Jun 2001, nix@esperi.demon.co.uk uttered the following:
> ./xgcc -B./ -B/usr/i586-pc-linux-gnu/bin/ -isystem /usr/i586-pc-linux-gnu/include -O2   -DIN_GCC    -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -isystem ./include  -fPIC -g1 -DHAVE_GTHR_DEFAULT -DIN_LIBGCC2 -D__GCC_FLOAT_NOT_NEEDED  -I. -I. -I/usr/packages/gcc/3.0-testing/gcc -I/usr/packages/gcc/3.0-testing/gcc/. -I/usr/packages/gcc/3.0-testing/gcc/config -I/usr/packages/gcc/3.0-testing/gcc/../include -fexceptions -c /usr/packages/gcc/3.0-testing/gcc/unwind-dw2.c -o libgcc/./unwind-dw2.o
> /usr/packages/gcc/3.0-testing/gcc/unwind-dw2.c: In function `extract_cie_info':
> /usr/packages/gcc/3.0-testing/gcc/unwind-dw2.c:219: warning: implicit declaration of function `strlen'
> /usr/packages/gcc/3.0-testing/gcc/unwind-dw2.c: In function `execute_stack_op':
> /usr/packages/gcc/3.0-testing/gcc/unwind-dw2.c:300: warning: `result' might be used uninitialized in this function
> /usr/packages/gcc/3.0-testing/gcc/unwind-dw2.c: In function `uw_frame_state_for':
> /usr/packages/gcc/3.0-testing/gcc/unwind-dw2.c:886: warning: implicit declaration of function `memset'
> /usr/packages/gcc/3.0-testing/gcc/unwind-dw2.c: In function `uw_install_context_1':
> /usr/packages/gcc/3.0-testing/gcc/unwind-dw2.c:1103: warning: implicit declaration of function `memcpy'
> /usr/packages/gcc/3.0-testing/gcc/unwind-dw2.c: At top level:
> /usr/packages/gcc/3.0-testing/gcc/unwind-dw2.c:1123: Internal error: Segmentation fault
> Please submit a full bug report,
> with preprocessed source if appropriate.
> See <URL:http://www.gnu.org/software/gcc/bugs.html> for instructions.

Some more (but regrettably little more) info on this crash:

- It doesn't happen if you preprocess the source first with -E, then run
  the compiler with -fpreprocessed.

- Running under gdb-5.0, cc1 behaves completely differently; it seems
  incapable of picking up the -I arguments, fails to find a bunch of
  headers included from machine-generated files (machmode.h for
  instance) and gives up. Running cc1 from the command line causes the
  crash I have come to love:

loki 2296 /usr/packages/gcc/i586-loki/gcc% ./cc1 -isystem /usr/i586-pc-linux-gnu/include -O2   -DIN_GCC    -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -isystem ./include  -fPIC -g1  -DIN_LIBGCC2 -D__GCC_FLOAT_NOT_NEEDED  -I. -I. -I../../3.0-testing/gcc -I../../3.0-testing/gcc/. -I../../3.0-testing/gcc/config -I../../3.0-testing/gcc/../include -fexceptions < ../../3.0-testing/gcc/unwind-dw2.c -o libgcc/./unwind-dw2.o >/dev/null 
 size_of_encoded_value base_of_encoded_value read_encoded_value_with_base read_encoded_value read_uleb128 read_sleb128 get_cie next_fde __gthread_active_p __gthread_mutex_lock
In file included from ../../3.0-testing/gcc/gthr.h:102,
                 from <stdin>:27:
../../3.0-testing/gcc/gthr-single.h: In function `__gthread_mutex_lock':
../../3.0-testing/gcc/gthr-single.h:218: warning: unused parameter `mutex'
 __gthread_mutex_trylock
../../3.0-testing/gcc/gthr-single.h: In function `__gthread_mutex_trylock':
../../3.0-testing/gcc/gthr-single.h:224: warning: unused parameter `mutex'
 __gthread_mutex_unlock
../../3.0-testing/gcc/gthr-single.h: In function `__gthread_mutex_unlock':
../../3.0-testing/gcc/gthr-single.h:230: warning: unused parameter `mutex'
 read_pointer read_1u read_1s read_2u read_2s read_4u read_4s read_8u read_8s _Unwind_GetGR _Unwind_SetGR _Unwind_GetIP _Unwind_SetIP _Unwind_GetLanguageSpecificData _Unwind_GetRegionStart _Unwind_GetDataRelBase _Unwind_GetTextRelBase extract_cie_info
<stdin>: In function `extract_cie_info':
<stdin>:219: warning: implicit declaration of function `strlen'
 execute_stack_op
<stdin>: In function `execute_stack_op':
<stdin>:300: warning: `result' might be used uninitialized in this function
 execute_cfa_program uw_frame_state_for
<stdin>: In function `uw_frame_state_for':
<stdin>:886: warning: implicit declaration of function `memset'
 uw_update_context_1 uw_update_context uw_init_context_1 init_dwarf_reg_size_table uw_install_context_1
<stdin>: In function `uw_install_context_1':
<stdin>:1103: warning: implicit declaration of function `memcpy'
 uw_identify_context _Unwind_RaiseException_Phase2 _Unwind_RaiseException _Unwind_ForcedUnwind_Phase2 _Unwind_ForcedUnwind _Unwind_Resume _Unwind_DeleteException
<stdin>:1123: Internal error: Segmentation fault
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://www.gnu.org/software/gcc/bugs.html> for instructions.

  Obviously gdb is affecting cc1's process environment in some way, but
  it isn't clear how. I've set args and redirected appropriately, but...

Note that judging from the function names flowing by, it's finished
compilation when it dies.

-- 
`This will immediately become a flamewar.' --- Mark Mitchell


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]