This is the mail archive of the 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][LTO] Committed patch to fix a crash due to syntax error.

On Thu, Oct 9, 2008 at 10:20 AM, Doug Kwan (關振紱) <> wrote:
> It does but that is no different from top of trunk or other verions.
> cc1plus will write something in the output file and abort the
> compilation with a non-zero exit code.  Note that the check for
> non-zero errcount.  The compiler will not crash only if there are
> syntax errors.  If there is no error and a GIMPLE_TRY_CATCH has an
> empty clean-up body, it is a problem in gcc and that should be caught
> by the assert.  From a usability point of view, it is better to just
> print an error instead of crashing.

Sure.  Just to clarify - the segfault is with the LTO frontend
or with the C++ frontend and -flto?  (that is, is the input
LTO data or a C++ program?)  If the former then I still think
this is the wrong approach.

> extern bool foo;
> void func() { if (foo) { try { return; } catch () {} } }
> -------
> $ rm -rf bug.s
> $ g++ -O2 -S  /* this is normal, non LTO gcc. */
> In function 'void func()':
> error: expected type-specifier before ')' token

So it doesn't crash?


> $ cat bug.s
>        .file   ""
>        .ident  "GCC: (GNU) 4.0.3 (Ubuntu 4.0.3-1ubuntu5)"
>        .section        .note.GNU-stack,"",@progbits
> $
> 2008/10/9 Richard Guenther <>:
>> Does this mean -flto writes out translation units which contain
>> errors?

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