Since the Alexander's changes I see: $ diff --git a/gcc/gcc.c b/gcc/gcc.c index e2362175f40..44090a8e713 100644 --- a/gcc/gcc.c +++ b/gcc/gcc.c @@ -6032,8 +6032,11 @@ do_spec_1 (const char *spec, int inswitch, const char *soft_matched_part) if (dumpdir_length) memcpy (tmp, dumpdir, dumpdir_length); if (!outbase_length) + { + gcc_assert (input_basename); memcpy (tmp + dumpdir_length, input_basename, basename_length); + } else memcpy (tmp + dumpdir_length, outbase, outbase_length); $ ./xgcc -B. /tmp/foo.c --save-temps xgcc: internal compiler error: in do_spec_1, at gcc.c:6036 0x403cea do_spec_1 /home/marxin/Programming/gcc/gcc/gcc.c:6036 0x4130a1 process_brace_body /home/marxin/Programming/gcc/gcc/gcc.c:7122
Created attachment 48673 [details] patch I'm testing Here's the patch I'm testing
The master branch has been updated by Alexandre Oliva <aoliva@gcc.gnu.org>: https://gcc.gnu.org/g:2e6a6644db0ef0f369df4e5b1b337122d84c1a39 commit r11-1014-g2e6a6644db0ef0f369df4e5b1b337122d84c1a39 Author: Alexandre Oliva <oliva@adacore.com> Date: Fri Jun 5 22:31:19 2020 -0300 [PR95456] avoid memcpy (_, NULL, 0) in gcc.c Some newly-added code in gcc.c might call memcpy with a NULL source pointer and zero-length inputs. Avoid such calls by rearranging the code a little. for gcc/ChangeLog PR driver/95456 * gcc.c (do_spec_1): Don't call memcpy (_, NULL, 0).
fixed