https://gcc.gnu.org/bugzilla/show_bug.cgi?id=112965

            Bug ID: 112965
           Summary: Valgrind error on gcc.dg/analyzer/fd-dup-1.c
           Product: gcc
           Version: 14.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: analyzer
          Assignee: dmalcolm at gcc dot gnu.org
          Reporter: jakub at gcc dot gnu.org
  Target Milestone: ---

With valgrind checking I'm seeing
Executing on host: /home/jakub/src/gcc/obj88/gcc/xgcc
-B/home/jakub/src/gcc/obj88/gcc/ 
/home/jakub/src/gcc/gcc/testsuite/gcc.dg/analyzer/fd-dup-1.c   
-fdiagnostics-plain-output   -
fanalyzer -Wanalyzer-too-complex -Wanalyzer-symbol-too-complex
-fanalyzer-call-summaries -S -o fd-dup-1.s    (timeout = 300)
spawn -ignore SIGHUP /home/jakub/src/gcc/obj88/gcc/xgcc
-B/home/jakub/src/gcc/obj88/gcc/
/home/jakub/src/gcc/gcc/testsuite/gcc.dg/analyzer/fd-dup-1.c
-fdiagnostics-plain-output -fana
lyzer -Wanalyzer-too-complex -Wanalyzer-symbol-too-complex
-fanalyzer-call-summaries -S -o fd-dup-1.s
==395421== Conditional jump or move depends on uninitialised value(s)
==395421==    at 0x1DC5D3E: search_line_sse42(unsigned char const*, unsigned
char const*) (lex.cc:467)
==395421==    by 0x1DC6944: _cpp_clean_line (lex.cc:960)
==395421==    by 0x1DC6DD2: bool get_fresh_line_impl<false>(cpp_reader*)
(lex.cc:3747)
==395421==    by 0x1DCB6FC: _cpp_get_fresh_line (lex.cc:3785)
==395421==    by 0x1DCB6FC: _cpp_lex_direct (lex.cc:3838)
==395421==    by 0x1DCD428: _cpp_lex_token (lex.cc:3670)
==395421==    by 0x1DD3A97: cpp_get_token_1(cpp_reader*, unsigned int*)
(macro.cc:2936)
==395421==    by 0x7DD20A: get_token (c-lex.cc:311)
==395421==    by 0x7DD20A: c_lex_with_flags(tree_node**, unsigned int*,
unsigned char*, int) (c-lex.cc:552)
==395421==    by 0x785BFA: consider_macro (c-parser.cc:1854)
==395421==    by 0x785BFA:
ana::c_translation_unit::lookup_constant_by_id(tree_node*) const
(c-parser.cc:1789)
==395421==    by 0x10540A5: ana::maybe_stash_named_constant(ana::logger*,
ana::translation_unit const&, char const*) (analyzer-language.cc:73)
==395421==    by 0x105449E: stash_named_constants (analyzer-language.cc:96)
==395421==    by 0x105449E:
ana::on_finish_translation_unit(ana::translation_unit const&)
(analyzer-language.cc:124)
==395421==    by 0x785442: c_parser_translation_unit (c-parser.cc:1935)
==395421==    by 0x785442: c_parse_file() (c-parser.cc:26713)
==395421==    by 0x7F6331: c_common_parse_file() (c-opts.cc:1301)
==395421== 
==395421== Use of uninitialised value of size 8
==395421==    at 0x1DC6948: _cpp_clean_line (lex.cc:962)
==395421==    by 0x1DC6DD2: bool get_fresh_line_impl<false>(cpp_reader*)
(lex.cc:3747)
==395421==    by 0x1DCB6FC: _cpp_get_fresh_line (lex.cc:3785)
==395421==    by 0x1DCB6FC: _cpp_lex_direct (lex.cc:3838)
==395421==    by 0x1DCD428: _cpp_lex_token (lex.cc:3670)
==395421==    by 0x1DD3A97: cpp_get_token_1(cpp_reader*, unsigned int*)
(macro.cc:2936)
==395421==    by 0x7DD20A: get_token (c-lex.cc:311)
==395421==    by 0x7DD20A: c_lex_with_flags(tree_node**, unsigned int*,
unsigned char*, int) (c-lex.cc:552)
==395421==    by 0x785BFA: consider_macro (c-parser.cc:1854)
==395421==    by 0x785BFA:
ana::c_translation_unit::lookup_constant_by_id(tree_node*) const
(c-parser.cc:1789)
==395421==    by 0x10540A5: ana::maybe_stash_named_constant(ana::logger*,
ana::translation_unit const&, char const*) (analyzer-language.cc:73)
==395421==    by 0x105449E: stash_named_constants (analyzer-language.cc:96)
==395421==    by 0x105449E:
ana::on_finish_translation_unit(ana::translation_unit const&)
(analyzer-language.cc:124)
==395421==    by 0x785442: c_parser_translation_unit (c-parser.cc:1935)
==395421==    by 0x785442: c_parse_file() (c-parser.cc:26713)
==395421==    by 0x7F6331: c_common_parse_file() (c-opts.cc:1301)
==395421==    by 0xCFF87D: compile_file() (toplev.cc:446)
I vaguely remember the buffers for libcpp need to be aligned at the end so that
the lex.cc fastpath can read it 8 bytes at a time, but I coiuld be wrong.

Reply via email to