aboutsummaryrefslogtreecommitdiff
path: root/gcc/jit
diff options
context:
space:
mode:
authorDavid Malcolm <dmalcolm@redhat.com>2019-11-20 17:51:41 +0000
committerDavid Malcolm <dmalcolm@gcc.gnu.org>2019-11-20 17:51:41 +0000
commit56e0452513b38110a711c402e32b34ad3a2354aa (patch)
tree67f018d6d93fb54b6504c983f2757c027e5fb427 /gcc/jit
parente307b05f4377a22811395f6a051d9db864b8785f (diff)
downloadgcc-56e0452513b38110a711c402e32b34ad3a2354aa.zip
gcc-56e0452513b38110a711c402e32b34ad3a2354aa.tar.gz
gcc-56e0452513b38110a711c402e32b34ad3a2354aa.tar.bz2
jit: fix ICE with GCC_JIT_BOOL_OPTION_SELFCHECK_GC since r278084 (PR jit/92483)
Since r278084 (part of the params refactoring), most of libgccjit's test suite has been ICEing. The root cause is that jit-playback.c injects params to its fake_args here: /* Aggressively garbage-collect, to shake out bugs: */ if (get_bool_option (GCC_JIT_BOOL_OPTION_SELFCHECK_GC)) { ADD_ARG ("--param"); ADD_ARG ("ggc-min-expand=0"); ADD_ARG ("--param"); ADD_ARG ("ggc-min-heapsize=0"); } (building a vec of char * where the char * are allocated using xstrdup) and r278084 added this logic to decode_cmdline_options_to_array: 964 /* Interpret "--param" "key=name" as "--param=key=name". */ 965 const char *needle = "--param"; 966 if (i + 1 < argc && strcmp (opt, needle) == 0) 967 { 968 const char *replacement 969 = opts_concat (needle, "=", argv[i + 1], NULL); 970 argv[++i] = replacement; 971 } Note that at line 970 it manipulates the argv in-place, inserting a new option allocated with opts_concat, which uses opts_obstack (itself initialized from toplev::main). jit-playback.c cleans up its fake arguments using "free", at which point we have a free of the middle of an obstack and an ICE. This patch fixes the issue by using the new syntax for the params. Fixes all 60 FAILs in jit.sum, restoring the number of PASS results from 2033 to 10469. gcc/jit/ChangeLog: PR jit/92483 * jit-playback.c (gcc::jit::playback::context::make_fake_args): Update GCC_JIT_BOOL_OPTION_SELFCHECK_GC for new --param syntax. From-SVN: r278515
Diffstat (limited to 'gcc/jit')
-rw-r--r--gcc/jit/ChangeLog6
-rw-r--r--gcc/jit/jit-playback.c6
2 files changed, 8 insertions, 4 deletions
diff --git a/gcc/jit/ChangeLog b/gcc/jit/ChangeLog
index 110367e..8eb6a7f 100644
--- a/gcc/jit/ChangeLog
+++ b/gcc/jit/ChangeLog
@@ -1,3 +1,9 @@
+2019-11-20 David Malcolm <dmalcolm@redhat.com>
+
+ PR jit/92483
+ * jit-playback.c (gcc::jit::playback::context::make_fake_args):
+ Update GCC_JIT_BOOL_OPTION_SELFCHECK_GC for new --param syntax.
+
2019-08-13 Richard Sandiford <richard.sandiford@arm.com>
PR middle-end/91421
diff --git a/gcc/jit/jit-playback.c b/gcc/jit/jit-playback.c
index 9eeb2a7..c043d69 100644
--- a/gcc/jit/jit-playback.c
+++ b/gcc/jit/jit-playback.c
@@ -2273,10 +2273,8 @@ make_fake_args (vec <char *> *argvec,
/* Aggressively garbage-collect, to shake out bugs: */
if (get_bool_option (GCC_JIT_BOOL_OPTION_SELFCHECK_GC))
{
- ADD_ARG ("--param");
- ADD_ARG ("ggc-min-expand=0");
- ADD_ARG ("--param");
- ADD_ARG ("ggc-min-heapsize=0");
+ ADD_ARG ("--param=ggc-min-expand=0");
+ ADD_ARG ("--param=ggc-min-heapsize=0");
}
if (get_bool_option (GCC_JIT_BOOL_OPTION_DUMP_EVERYTHING))