The problem happens when we generate temp file
for .res file. Tested locally with the problematic
options.

Ready for master?
Thanks,
Martin

gcc/ChangeLog:

        PR driver/95456
        * gcc.c (do_spec_1): Append to tempfile only when
        input_basename != NULL.
---
 gcc/gcc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gcc/gcc.c b/gcc/gcc.c
index e2362175f40..6dea22c0669 100644
--- a/gcc/gcc.c
+++ b/gcc/gcc.c
@@ -6031,7 +6031,7 @@ do_spec_1 (const char *spec, int inswitch, const char 
*soft_matched_part)
                    tmp = (char *) alloca (temp_filename_length);
                    if (dumpdir_length)
                      memcpy (tmp, dumpdir, dumpdir_length);
-                   if (!outbase_length)
+                   if (!outbase_length && input_basename != NULL)
                      memcpy (tmp + dumpdir_length, input_basename,
                              basename_length);
                    else
--
2.26.2

Reply via email to