This is the mail archive of the gcc-patches@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]
Other format: [Raw text]

Re: [PATCH] Fix GCC driver ICE on invalid abuse of specs (PR driver/30460)


Jakub Jelinek wrote:
Hi!

asm_debug variable isn't initialized to ASM_DEBUG_SPEC unlike all the other
static specs to work around some Irix cc bug and so is assigned only at
runtime.  But it is done only in init_spec and in the case where some -B xxx/
subdir contains an invalid hand-crafted specs (the default spec should be
always created from -dumpspecs and editing it, or better yet just using an
overriding -specs=xxx.spec) asm_debug is therefore uninitialized.
The PR submitter argues that init_spec should be called always, but that
would be a behavior change and for correctly created default specs even
unnecessary wasting of driver cycles.
This patch fixes this segfault instead by just initializing it always as
soon as possible (i.e. in main rather than init_spec).  If we wouldn't work
around Irix cc bugs, it would be already initialized by the time we reach
main through static initializer.

Tested on x86_64-linux, ok for trunk?

2007-11-12 Jakub Jelinek <jakub@redhat.com>

	PR driver/30460
	* gcc.c (init_spec): Don't initialize asm_debug here...
	(main): ... but here.

Looks fine to me. Do we have anyone listed as driver maintainers, btw?
I was going to ask them to comment on it, but I don't find anyone obvious in MAINTAINERS.



Diego.



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