Segmentation Fault while trying to compile a file with the -Xpreprocessor argument : If the file specified after -Xpreprocessor , does not exist, then gcc crash. How to reproduce the bug : $ gcc filename.c -Xpreprocessor file_which_does_not_exist --filename.c must exist. Here is what it gives : $ gcc fpexe.c -Xpreprocessor a cc1: ss : No such file or directory cc1: erreur interne du compilateur: Segmentation fault Please submit a full bug report, with preprocessed source if appropriate. See <URL:http://gcc.gnu.org/bugs.html> for instructions.
Confirmed, here is the backtrace: #0 0x080ef546 in init_emit () at ../../gcc/emit-rtl.c:5354 #1 0x08133b2e in prepare_function_start (fndecl=0x0) at ../../gcc/function.c:6460 #2 0x08275fef in toplev_main (argc=0, argv=0xbfffe9b0) at ../../gcc/toplev.c:4539 #3 0x0809962e in main (argc=0, argv=0x0) at ../../gcc/main.c:35
Fixed in 4.0.0 by: http://gcc.gnu.org/ml/gcc/2004-04/msg00645.html
Hint taken. I'm testing the patch with gcc-3.4, and then will check it in if there are no problems.
Subject: Bug 20364 CVSROOT: /cvs/gcc Module name: gcc Branch: gcc-3_4-branch Changes by: wilson@gcc.gnu.org 2005-03-09 01:00:56 Modified files: gcc : ChangeLog c-opts.c Log message: Fix for PR middle-end/20364, backported from mainline. Backport from mainline 2004-04-13 James E Wilson <wilson@specifixinc.com> PR middle-end/20364 * c-opt.c (c_common_post_options): If this_input_filename is NULL, increment errorcount and return false instead of true. Patches: http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=2.2326.2.813&r2=2.2326.2.814 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/c-opts.c.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=1.96.4.9&r2=1.96.4.10
Fix by the patch I just checked in.
*** Bug 20281 has been marked as a duplicate of this bug. ***
*** Bug 21504 has been marked as a duplicate of this bug. ***