This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug ada/11581] [3.4 Regression] gnat1 segfaults if it does receive any arguments
- From: "ro at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 24 Jul 2003 19:57:48 -0000
- Subject: [Bug ada/11581] [3.4 Regression] gnat1 segfaults if it does receive any arguments
- References: <20030718202235.11581.steven@gcc.gnu.org>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=11581
ro at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |ro at techfak dot uni-
| |bielefeld dot de
------- Additional Comments From ro at gcc dot gnu dot org 2003-07-24 19:57 -------
The same problem happens with jc1 and f771 on sparc-sun-solaris2.8. It seems to
happen on all platforms which crash on strlen(NULL).
All crashes show the same stack trace:
#0 0xff1b3200 in strlen () from /usr/lib/libc.so.1
#1 0x00490ff4 in output_file_directive (asm_file=0x879898, input_name=0x0)
at /vol/gnu/src/gcc/gcc-dist/gcc/toplev.c:1403
#2 0x00495e14 in init_asm_output (name=0x657800 "")
at /vol/gnu/src/gcc/gcc-dist/gcc/toplev.c:4077
#3 0x004966ac in lang_dependent_init (name=0x0)
at /vol/gnu/src/gcc/gcc-dist/gcc/toplev.c:4409
#4 0x0049694c in do_compile () at /vol/gnu/src/gcc/gcc-dist/gcc/toplev.c:4517
#5 0x00496a78 in toplev_main (argc=1, argv=0xffbef4cc)
at /vol/gnu/src/gcc/gcc-dist/gcc/toplev.c:4567
In toplev.c (output_file_directive), strlen is called with a NULL input_name.
The fix may be to simply initialize toplev.c (main_input_filename) to <stdin>,
as cppfiles.c does. cc1, cc1plus, and cc1obj are not affected and simply
emit <stdin>.s instead.