From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id C59D53858D37; Mon, 11 Dec 2023 10:04:30 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org C59D53858D37 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1702289070; bh=Y5XFwWZuevZAbRqRj54sp+K/koKqjt6KamL+SGzIsDw=; h=From:To:Subject:Date:From; b=pMN/l0xTwu/WuFjjWT3f2ZoLogoqze+0tyx8pAtCmju+yQ07FgEiK3MkUu1s3Ym1R mysCyJ27gQgqp7RnoOWp/uaJTdnMdgN1/hCoDEODbX98ksV4fICZfLQWsEuWbZ5k2r 3NoVSFmxZZln1v8waOQ4V3Fzb2C2I3mIdnhi4xcE= From: "jakub at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug preprocessor/112956] New: Valgrind errors on pr88974.c Date: Mon, 11 Dec 2023 10:04:29 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: preprocessor X-Bugzilla-Version: 14.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: jakub at gcc dot gnu.org X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter target_milestone Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D112956 Bug ID: 112956 Summary: Valgrind errors on pr88974.c Product: gcc Version: 14.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: preprocessor Assignee: unassigned at gcc dot gnu.org Reporter: jakub at gcc dot gnu.org Target Milestone: --- With valgrind checking I'm seeing: /home/jakub/src/gcc/obj88/gcc/xgcc -B/home/jakub/src/gcc/obj88/gcc/ /home/jakub/src/gcc/gcc/testsuite/c-c++-common/cpp/pr88974.c -fdiagnostics-plain-output -Wc++ -compat -E -o pr88974.i /home/jakub/src/gcc/gcc/testsuite/c-c++-common/cpp/pr88974.c:4:31: error: missing terminating > character /home/jakub/src/gcc/gcc/testsuite/c-c++-common/cpp/pr88974.c:4:31: error: missing ')' after "__has_include" operand =3D=3D600549=3D=3D Conditional jump or move depends on uninitialised value(= s) =3D=3D600549=3D=3D at 0x1DD3A05: cpp_get_token_1(cpp_reader*, unsigned i= nt*) (macro.cc:3050) =3D=3D600549=3D=3D by 0x1DBFC7F: _cpp_parse_expr (expr.cc:1392) =3D=3D600549=3D=3D by 0x1DB9471: do_if(cpp_reader*) (directives.cc:2087) =3D=3D600549=3D=3D by 0x1DBB4D8: _cpp_handle_directive (directives.cc:57= 2) =3D=3D600549=3D=3D by 0x1DCD488: _cpp_lex_token (lex.cc:3682) =3D=3D600549=3D=3D by 0x1DD3A97: cpp_get_token_1(cpp_reader*, unsigned i= nt*) (macro.cc:2936) =3D=3D600549=3D=3D by 0x7F7EE4: scan_translation_unit (c-ppoutput.cc:350) =3D=3D600549=3D=3D by 0x7F7EE4: preprocess_file(cpp_reader*) (c-ppoutput= .cc:106) =3D=3D600549=3D=3D by 0x7F6235: c_common_init() (c-opts.cc:1280) =3D=3D600549=3D=3D by 0x704C8B: lang_dependent_init (toplev.cc:1837) =3D=3D600549=3D=3D by 0x704C8B: do_compile (toplev.cc:2135) =3D=3D600549=3D=3D by 0x704C8B: toplev::main(int, char**) (toplev.cc:230= 6) =3D=3D600549=3D=3D by 0x7064BA: main (main.cc:39) --- libcpp/lex.cc.jj 2023-12-01 08:10:44.686296604 +0100 +++ libcpp/lex.cc 2023-12-11 10:58:08.907527616 +0100 @@ -3833,6 +3833,7 @@ _cpp_lex_direct (cpp_reader *pfile) pfile->state.in_deferred_pragma =3D false; if (!pfile->state.pragma_allow_expansion) pfile->state.prevent_expansion--; + result->src_loc =3D 0; return result; } if (!_cpp_get_fresh_line (pfile)) @@ -3849,6 +3850,8 @@ _cpp_lex_direct (cpp_reader *pfile) /* Now pop the buffer that _cpp_get_fresh_line did not. */ _cpp_pop_buffer (pfile); } + else + result->src_loc =3D 0; return result; } if (buffer !=3D pfile->buffer) or even just the second hunk of it fixes this (but otherwise untested so fa= r).=