Bug 20364 - [3.4 Regression] Segfault with -Xpreprocessor argument
Summary: [3.4 Regression] Segfault with -Xpreprocessor argument
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: middle-end (show other bugs)
Version: 3.4.1
: P2 normal
Target Milestone: 3.4.4
Assignee: Jim Wilson
URL:
Keywords: ice-on-invalid-code
: 20281 21504 (view as bug list)
Depends on:
Blocks:
 
Reported: 2005-03-07 18:48 UTC by Hug
Modified: 2005-05-10 21:01 UTC (History)
4 users (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed: 2005-03-08 20:53:54


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Hug 2005-03-07 18:48:23 UTC
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.
Comment 1 Andrew Pinski 2005-03-07 18:58:58 UTC
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
Comment 2 Andrew Pinski 2005-03-07 19:02:38 UTC
Fixed in 4.0.0 by:
http://gcc.gnu.org/ml/gcc/2004-04/msg00645.html
Comment 3 Jim Wilson 2005-03-08 20:53:54 UTC
Hint taken.  I'm testing the patch with gcc-3.4, and then will check it in if
there are no problems.
Comment 4 GCC Commits 2005-03-09 01:01:12 UTC
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

Comment 5 Jim Wilson 2005-03-09 01:10:12 UTC
Fix by the patch I just checked in.
Comment 6 Jim Wilson 2005-03-10 04:47:18 UTC
*** Bug 20281 has been marked as a duplicate of this bug. ***
Comment 7 Andrew Pinski 2005-05-10 21:01:51 UTC
*** Bug 21504 has been marked as a duplicate of this bug. ***