]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
gcn/mkoffload.cc: Re-add fprintf for #include of stdlib.h/stdbool.h
authorTobias Burnus <tburnus@baylibre.com>
Mon, 23 Sep 2024 08:24:05 +0000 (10:24 +0200)
committerTobias Burnus <tburnus@baylibre.com>
Mon, 23 Sep 2024 08:24:05 +0000 (10:24 +0200)
In commit r15-3629-g508ef585243d4674d06b0737bfe8769fc18f824f, #embed
was added and no longer required fprintf '#include' removed, missing
somehow that with -mstack-size=, the generated configure_stack_size
will use 'setenv' and 'true'.

gcc/ChangeLog:

* config/gcn/mkoffload.cc (process_asm): (Re)add the fprintf
lines for stdlib.h/stdbool.h inclusion if gcn_stack_size is used.

gcc/config/gcn/mkoffload.cc

index 1f6337719e9d161d7d5c526742f8a70c93363331..1a524ced6535dd5efaa95121a1b65104120c41f1 100644 (file)
@@ -613,6 +613,12 @@ process_asm (FILE *in, FILE *out, FILE *cfile)
   struct oaccdims *dims = XOBFINISH (&dims_os, struct oaccdims *);
   struct regcount *regcounts = XOBFINISH (&regcounts_os, struct regcount *);
 
+  if (gcn_stack_size)
+    {
+      fprintf (cfile, "#include <stdlib.h>\n");
+      fprintf (cfile, "#include <stdbool.h>\n\n");
+    }
+
   fprintf (cfile, "static const int gcn_num_vars = %d;\n\n", var_count);
   fprintf (cfile, "static const int gcn_num_ind_funcs = %d;\n\n", ind_fn_count);