summaryrefslogtreecommitdiff
path: root/gcc/gcc.c
diff options
context:
space:
mode:
authordmalcolm <dmalcolm@138bc75d-0d04-0410-961f-82ee72b054a4>2016-02-12 18:37:35 +0000
committerdmalcolm <dmalcolm@138bc75d-0d04-0410-961f-82ee72b054a4>2016-02-12 18:37:35 +0000
commit5af71a8fde125f3f02c1eef7105bad5b8f6ebcd8 (patch)
tree0ca55fb63f196338796acc38bea4175d8353bda3 /gcc/gcc.c
parentda7d506649266e077fb495752d08c127c96e45cb (diff)
downloadgcc-5af71a8fde125f3f02c1eef7105bad5b8f6ebcd8.tar.gz
PR driver/69779: fix bogus cleanup code used by libgccjit affecting s390x
gcc/ChangeLog: PR driver/69779 * gcc.c (driver::finalize): Fix cleanup of "specs". git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@233385 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/gcc.c')
-rw-r--r--gcc/gcc.c16
1 files changed, 14 insertions, 2 deletions
diff --git a/gcc/gcc.c b/gcc/gcc.c
index 99fa5e386a5..eaa46532270 100644
--- a/gcc/gcc.c
+++ b/gcc/gcc.c
@@ -9954,8 +9954,20 @@ driver::finalize ()
multilib_os_dir = 0;
multiarch_dir = 0;
- XDELETEVEC (specs);
- specs = 0;
+ /* Free any specs dynamically-allocated by set_spec.
+ These will be at the head of the list, before the
+ statically-allocated ones. */
+ if (specs)
+ {
+ while (specs != static_specs)
+ {
+ spec_list *next = specs->next;
+ free (const_cast <char *> (specs->name));
+ XDELETE (specs);
+ specs = next;
+ }
+ specs = 0;
+ }
for (unsigned i = 0; i < ARRAY_SIZE (static_specs); i++)
{
spec_list *sl = &static_specs[i];