Do not strcat to result of getenv.
authorMartin Liska <mliska@suse.cz>
Fri, 13 Mar 2020 12:50:01 +0000 (13:50 +0100)
committerMartin Liska <mliska@suse.cz>
Fri, 13 Mar 2020 12:50:01 +0000 (13:50 +0100)
PR lto/94157
* lto-wrapper.c (run_gcc): Use concat for appending
to collect_gcc_options.
PR lto/94157
* gcc.dg/lto/pr94157_0.c: New test.

gcc/ChangeLog
gcc/lto-wrapper.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/lto/pr94157_0.c [new file with mode: 0644]

index 448c1e138fa89e15993dfffe15611941dcf3e1f2..679296ffcaca91b0bce8300ecaed5d99060fe4d5 100644 (file)
@@ -1,3 +1,9 @@
+2020-03-13  Martin Liska  <mliska@suse.cz>
+
+       PR lto/94157
+       * lto-wrapper.c (run_gcc): Use concat for appending
+       to collect_gcc_options.
+
 2020-03-13  Jakub Jelinek  <jakub@redhat.com>
 
        PR target/94121
index b8a35c857140dbc9d67645e28d1a299787c93df3..46a88b233f6fa57a6cc3f2e0e38af771f648d7ab 100644 (file)
@@ -1317,7 +1317,8 @@ run_gcc (unsigned argc, char *argv[])
 
       char *xassembler_opts_string
        = XOBFINISH (&temporary_obstack, char *);
-      strcat (collect_gcc_options, xassembler_opts_string);
+      collect_gcc_options = concat (collect_gcc_options, xassembler_opts_string,
+                                   NULL);
     }
 
   get_options_from_collect_gcc_options (collect_gcc, collect_gcc_options,
index 4c6d7edda7e53ec125b1afedd0945b1c6f36d93a..6e2099bec5a4f018c0eea64ae366d9756e02ec75 100644 (file)
@@ -1,3 +1,8 @@
+2020-03-13  Martin Liska  <mliska@suse.cz>
+
+       PR lto/94157
+       * gcc.dg/lto/pr94157_0.c: New test.
+
 2020-03-13  Kewen Lin  <linkw@gcc.gnu.org>
 
        PR testsuite/93935
diff --git a/gcc/testsuite/gcc.dg/lto/pr94157_0.c b/gcc/testsuite/gcc.dg/lto/pr94157_0.c
new file mode 100644 (file)
index 0000000..3bca677
--- /dev/null
@@ -0,0 +1,6 @@
+/* { dg-lto-do link } */
+/* { dg-lto-options { { -O0 -fipa-vrp -flto -Wa,--noexecstack -Wa,--noexecstack -Wa,--execstack  -Wa,--execstack -Wa,--execstack -Wa,--execstack -Wa,--execstack -Wa,--execstack -Wa,--execstack -Wa,--execstack -Wa,--execstack -Wa,--execstack -Wa,--execstack -Wa,--execstack -Wa,--execstack -Wa,--execstack } } } */
+
+int main() {
+
+}