From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 7850) id A9591384F010; Mon, 31 May 2021 16:29:50 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org A9591384F010 MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="utf-8" From: Indu Bhagat To: gcc-cvs@gcc.gnu.org Subject: [gcc r12-1132] PR testsuite/100749 - gcc.dg/pch/valid-1.c fails after r12-949 X-Act-Checkin: gcc X-Git-Author: Indu Bhagat X-Git-Refname: refs/heads/master X-Git-Oldrev: bdf1a4026a2517fada8ee4e8b6f114295f69ef26 X-Git-Newrev: a87efd32384ee78ee33d20703deaa65fba81cb2d Message-Id: <20210531162950.A9591384F010@sourceware.org> Date: Mon, 31 May 2021 16:29:50 +0000 (GMT) X-BeenThere: gcc-cvs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-cvs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 31 May 2021 16:29:50 -0000 https://gcc.gnu.org/g:a87efd32384ee78ee33d20703deaa65fba81cb2d commit r12-1132-ga87efd32384ee78ee33d20703deaa65fba81cb2d Author: Indu Bhagat Date: Mon May 31 09:19:38 2021 -0700 PR testsuite/100749 - gcc.dg/pch/valid-1.c fails after r12-949 Fix failing pch testcases. Use xstrdup to retain a reliable copy of the debug format str containing the names (df_set_names is a static string var). 2021-05-31 Indu Bhagat gcc/c-family/ PR testsuite/100749 * c-pch.c (c_common_valid_pch): Use xstrdup for debug format set names. Diff: --- gcc/c-family/c-pch.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/gcc/c-family/c-pch.c b/gcc/c-family/c-pch.c index 8f0f76024a2..5da60423354 100644 --- a/gcc/c-family/c-pch.c +++ b/gcc/c-family/c-pch.c @@ -255,10 +255,13 @@ c_common_valid_pch (cpp_reader *pfile, const char *name, int fd) if (v.pch_write_symbols != write_symbols && write_symbols != NO_DEBUG) { + char *created_str = xstrdup (debug_set_names (v.pch_write_symbols)); + char *used_str = xstrdup (debug_set_names (write_symbols)); cpp_warning (pfile, CPP_W_INVALID_PCH, "%s: created with '%s' debug info, but used with '%s'", name, - debug_set_names (v.pch_write_symbols), - debug_set_names (write_symbols)); + created_str, used_str); + free (created_str); + free (used_str); return 2; }