This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [RFA][PATCH] Isolate erroneous paths optimization
- From: Richard Biener <richard dot guenther at gmail dot com>
- To: Ian Lance Taylor <iant at google dot com>
- Cc: gcc-patches <gcc-patches at gcc dot gnu dot org>, Jeff Law <law at redhat dot com>
- Date: Wed, 6 Nov 2013 16:23:06 +0100
- Subject: Re: [RFA][PATCH] Isolate erroneous paths optimization
- Authentication-results: sourceware.org; auth=none
- References: <5271F493 dot 4020308 at redhat dot com> <CAFiYyc2tFbaTq4xr8xZA5wb_m9pB4+VA-9MkmNDXTVkP2gQdBA at mail dot gmail dot com> <52785087 dot 3060908 at redhat dot com> <CAKOQZ8x5FAnYzkepikoJSpX9467H0Xx_28SO3abGu6J+PSpNEQ at mail dot gmail dot com> <alpine dot DEB dot 2 dot 10 dot 1311060743550 dot 4174 at laptop-mg dot saclay dot inria dot fr> <CAKOQZ8xS5Dpk9Fe9wvRpQ3WC_1NsPMSkomGqav5p0ijhKKCkSQ at mail dot gmail dot com> <CAFiYyc0es-DxOwbcka2RtiP4HshSWMcj-3nOdFCvXD39pvXJnA at mail dot gmail dot com> <CAKOQZ8zYjMzGuGRGbL75bkPHc1gKVcTBaBcwkhhbC3nOhjXvrQ at mail dot gmail dot com> <CAFiYyc1JiWcH05crFnO9tMdouw=Z3TDgexpCTOfX4ezMsF-oTw at mail dot gmail dot com> <CAKOQZ8ytOYug0+FFP6kR_yov1N_D6NERT3Y-n6806xp2GqyPkQ at mail dot gmail dot com>
On Wed, Nov 6, 2013 at 4:20 PM, Ian Lance Taylor <iant@google.com> wrote:
> On Wed, Nov 6, 2013 at 7:15 AM, Richard Biener
> <richard.guenther@gmail.com> wrote:
>>
>> But I think that you cannot transform
>>
>> foo ()
>> {
>> *0 = 1;
>> }
>>
>> to __builtin_trap as you can catch the trap via an exception handler
>> in a caller of foo, no?
>
> That is true. OK, I can see an argument that when using
> -fnon-call-exceptions that kind of code should not be changed to call
> __builtin_trap.
>
> In that case I think it would be fine to run the isolate paths
> optimization, but to not omit the actual dereference of the NULL
> pointer (possibly the dereference could be followed by a trap).
Yeah, we need the trap to properly end the BB (even if that is a
waste instruction generated).
Richard.
> Ian