Bug 34867 - valgrind error indication in testsuite from c-lex.c:996:c_lex_with_flags for gcc.dg/cpp/charconst.c
Summary: valgrind error indication in testsuite from c-lex.c:996:c_lex_with_flags for ...
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: c (show other bugs)
Version: 4.3.0
: P3 normal
Target Milestone: 4.4.0
Assignee: Laurynas Biveinis
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-01-19 11:01 UTC by Hans-Peter Nilsson
Modified: 2008-06-27 12:32 UTC (History)
3 users (show)

See Also:
Host:
Target: x86_64-unknown-linux-gnu
Build:
Known to work:
Known to fail:
Last reconfirmed: 2008-06-22 15:23:44


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Hans-Peter Nilsson 2008-01-19 11:01:12 UTC
A r131535 of trunk (a later revision is recommended, at least >= r131589) bootstrapped with --enable-langugages=c --enable-checking=release,valgrind shows these indications for gcc.dg/cpp/charconst.c (show as in gcc.log):
Executing on host: /tmp/hptest8/obj/gcc/xgcc -B/tmp/hptest8/obj/gcc/ /tmp/hptest8/gcc/gcc/testsuite/gcc.dg/cpp/charconst.c    -ans
i -pedantic-errors -fno-show-column -S  -o charconst.s    (timeout = 300)
/tmp/hptest8/gcc/gcc/testsuite/gcc.dg/cpp/charconst.c:10: error: empty character constant
/tmp/hptest8/gcc/gcc/testsuite/gcc.dg/cpp/charconst.c:12: error: empty character constant
/tmp/hptest8/gcc/gcc/testsuite/gcc.dg/cpp/charconst.c:14: warning: character constant too long for its type
/tmp/hptest8/gcc/gcc/testsuite/gcc.dg/cpp/charconst.c:16: warning: character constant too long for its type
/tmp/hptest8/gcc/gcc/testsuite/gcc.dg/cpp/charconst.c:19: warning: multi-character character constant
/tmp/hptest8/gcc/gcc/testsuite/gcc.dg/cpp/charconst.c:27: error: empty character constant
==23842== Conditional jump or move depends on uninitialised value(s)
==23842==    at 0x4041B7: c_lex_with_flags (c-lex.c:996)
==23842==    by 0x44D20E: c_lex_one_token (c-parser.c:310)
==23842==    by 0x453666: c_parser_cast_expression (c-parser.c:415)
==23842==    by 0x4537C1: c_parser_conditional_expression (c-parser.c:4691)
==23842==    by 0x453F24: c_parser_expr_no_commas (c-parser.c:4452)
==23842==    by 0x4540A6: c_parser_expr_no_commas (c-parser.c:4492)
==23842==    by 0x454121: c_parser_expression (c-parser.c:5699)
==23842==    by 0x4543E8: c_parser_expression_conv (c-parser.c:5719)
==23842==    by 0x450AB5: c_parser_statement_after_labels (c-parser.c:3880)
==23842==    by 0x451C07: c_parser_compound_statement_nostart (c-parser.c:3565)
==23842==    by 0x457004: c_parser_compound_statement (c-parser.c:3413)
==23842==    by 0x45750C: c_parser_declaration_or_fndef (c-parser.c:1412)
/tmp/hptest8/gcc/gcc/testsuite/gcc.dg/cpp/charconst.c:28: error: empty character constant
/tmp/hptest8/gcc/gcc/testsuite/gcc.dg/cpp/charconst.c:30: warning: character constant too long for its type
/tmp/hptest8/gcc/gcc/testsuite/gcc.dg/cpp/charconst.c:31: warning: character constant too long for its type
/tmp/hptest8/gcc/gcc/testsuite/gcc.dg/cpp/charconst.c:33: warning: multi-character character constant
/tmp/hptest8/gcc/gcc/testsuite/gcc.dg/cpp/charconst.c:35: warning: character constant too long for its type
Comment 1 Laurynas Biveinis 2008-06-22 15:23:44 UTC
Confirmed with r137000.

To set unsignedp value, lex_charconst calls cpp_interpret_charconst. Here it quits early with an error, leaving unsignedp uninitialized. I will post a patch to fix.
Comment 2 Laurynas Biveinis 2008-06-27 12:30:41 UTC
Subject: Bug 34867

Author: lauras
Date: Fri Jun 27 12:29:55 2008
New Revision: 137175

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=137175
Log:
2008-06-27  Laurynas Biveinis  <laurynas.biveinis@gmail.com>

	PR c/34867
	* c-lex.c (lex_charconst): Initialize unsignedp.


Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/c-lex.c

Comment 3 Laurynas Biveinis 2008-06-27 12:32:14 UTC
Fixed on trunk.