This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [buildrobot] Re: [PATCH] Split -fisolate-erroneous-paths into two options
- From: Ian Lance Taylor <iant at google dot com>
- To: Jan-Benedict Glaw <jbglaw at lug-owl dot de>
- Cc: Jeff Law <law at redhat dot com>, gcc-patches <gcc-patches at gcc dot gnu dot org>, "gofrontend-dev at googlegroups dot com" <gofrontend-dev at googlegroups dot com>
- Date: Thu, 5 Dec 2013 08:41:02 -0800
- Subject: Re: [buildrobot] Re: [PATCH] Split -fisolate-erroneous-paths into two options
- Authentication-results: sourceware.org; auth=none
- References: <529FF0C1 dot 3090406 at redhat dot com> <20131205081829 dot GZ30563 at lug-owl dot de>
On Thu, Dec 5, 2013 at 12:18 AM, Jan-Benedict Glaw <jbglaw@lug-owl.de> wrote:
> On Wed, 2013-12-04 20:19:29 -0700, Jeff Law <law@redhat.com> wrote:
>> This patch splits up the erroneous path optimization into two
>> pieces. One which detects NULL dereferences and isolates those paths
>> and a second which detects passing/returning a NULL pointer in cases
>> where an attribute says a non-NULL value is required.
> [...]
>
> This seems to break Go, see eg.
> http://toolchain.lug-owl.de/buildbot/show_build_details.php?id=50428 :
>
> g++ -c -DDEFAULT_TARGET_VERSION=\"4.9.0\" -DDEFAULT_TARGET_MACHINE=\"i686-pc-linux-gnu\" -DIN_GCC_FRONTEND -g -O2 -DIN_GCC -DCROSS_DIRECTORY_STRUCTURE -fno-exceptions -fno-rtti -fasynchronous-unwind-tables -W -Wall -Wno-narrowing -Wwrite-strings -Wcast-qual -Wmissing-format-attribute -pedantic -Wno-long-long -Wno-variadic-macros -Wno-overlength-strings -Werror -fno-common -DHAVE_CONFIG_H -I. -Igo -I../../../gcc/gcc -I../../../gcc/gcc/go -I../../../gcc/gcc/../include -I../../../gcc/gcc/../libcpp/include -I/opt/cfarm/mpc/include -I../../../gcc/gcc/../libdecnumber -I../../../gcc/gcc/../libdecnumber/bid -I../libdecnumber -I../../../gcc/gcc/../libbacktrace -o go/go-lang.o -MT go/go-lang.o -MMD -MP -MF go/.deps/go-lang.TPo ../../../gcc/gcc/go/go-lang.c
> ../../../gcc/gcc/go/go-lang.c: In function ‘bool go_langhook_post_options(const char**)’:
> ../../../gcc/gcc/go/go-lang.c:276:27: error: ‘struct gcc_options’ has no member named ‘x_flag_isolate_erroneous_paths’
> if (!global_options_set.x_flag_isolate_erroneous_paths)
> ^
> ../../../gcc/gcc/go/go-lang.c:277:20: error: ‘struct gcc_options’ has no member named ‘x_flag_isolate_erroneous_paths’
> global_options.x_flag_isolate_erroneous_paths = 0;
> ^
> make[2]: *** [go/go-lang.o] Error 1
I've committed this patch to mainline to fix this problem. I could
have removed this code earlier but hadn't gotten around to it.
Ian
2013-12-05 Ian Lance Taylor <iant@google.com>
Revert this change; no longer required.
2013-11-06 Ian Lance Taylor <iant@google.com>
* go-lang.c (go_langhook_post_options): If
-fisolate-erroneous-paths was turned on by an optimization option,
turn it off.
Index: gcc/go/go-lang.c
===================================================================
--- gcc/go/go-lang.c (revision 205710)
+++ gcc/go/go-lang.c (working copy)
@@ -270,12 +270,6 @@ go_langhook_post_options (const char **p
if (flag_excess_precision_cmdline == EXCESS_PRECISION_DEFAULT)
flag_excess_precision_cmdline = EXCESS_PRECISION_STANDARD;
- /* The isolate_erroneous_paths optimization can change a nil
- dereference from a panic to a trap, so we have to disable it for
- Go, even though it is normally enabled by -O2. */
- if (!global_options_set.x_flag_isolate_erroneous_paths)
- global_options.x_flag_isolate_erroneous_paths = 0;
-
/* Returning false means that the backend should be used. */
return false;
}