[PATCH,AIX] Nil check size threshold control for AIX

Ian Lance Taylor iant@golang.org
Tue Dec 12 17:30:00 GMT 2017


On Tue, Dec 12, 2017 at 12:59 AM, REIX, Tony <tony.reix@atos.net> wrote:
> Description:
>  * This patch tells the Go frontend to insert explicit guards (check for nil -> panic) for AIX since relying on a fault does not work on AIX for page 0.
>
> Tests:
>  * AIX: Build: SUCCESS
>    - build made by means of gmake.
>
> ChangeLog:
>   * go-lang.c (go_langhook_init): Handle AIX case for nil_check_size_threshold.

Thanks.  I changed it to avoid #ifdef in the middle of the function,
and committed as follows.

Ian

2017-12-12  Tony Reix  <tony.reix@atos.net>
    Ian Lance Taylor  <iant@golang.org>

* go-lang.c (TARGET_AIX): Define if not defined.
(go_langhook_init): Set nil_check_size_threshold to -1 on AIX.
-------------- next part --------------
Index: gcc/go/go-lang.c
===================================================================
--- gcc/go/go-lang.c	(revision 255581)
+++ gcc/go/go-lang.c	(working copy)
@@ -39,6 +39,10 @@ along with GCC; see the file COPYING3.
 #include "go-c.h"
 #include "go-gcc.h"
 
+#ifndef TARGET_AIX
+#define TARGET_AIX 0
+#endif
+
 /* Language-dependent contents of a type.  */
 
 struct GTY(()) lang_type
@@ -112,7 +116,7 @@ go_langhook_init (void)
   args.check_divide_overflow = go_check_divide_overflow;
   args.compiling_runtime = go_compiling_runtime;
   args.debug_escape_level = go_debug_escape_level;
-  args.nil_check_size_threshold = 4096;
+  args.nil_check_size_threshold = TARGET_AIX ? -1 : 4096;
   args.linemap = go_get_linemap();
   args.backend = go_get_backend();
   go_create_gogo (&args);


More information about the Gcc-patches mailing list