Summary: | [4.3/4.4/4.5/4.6 Regression] missing uninitialized warning (builtin functions) | ||
---|---|---|---|
Product: | gcc | Reporter: | Andrew Pinski <pinskia> |
Component: | c | Assignee: | Not yet assigned to anyone <unassigned> |
Status: | RESOLVED FIXED | ||
Severity: | minor | CC: | gcc-bugs, manu, nicola |
Priority: | P5 | Keywords: | diagnostic |
Version: | 4.1.0 | ||
Target Milestone: | 4.6.0 | ||
Host: | Target: | ||
Build: | Known to work: | 4.6.0 | |
Known to fail: | 4.0.4 | Last reconfirmed: | 2009-02-06 15:46:39 |
Bug Depends on: | |||
Bug Blocks: | 24639 |
Description
Andrew Pinski
2005-07-04 20:31:08 UTC
The patch here fixes one issue: <http://gcc.gnu.org/ml/gcc-patches/2005-07/msg00211.html>. But the next problem is located in the front-end: #0 default_function_array_conversion (exp={value = 0x41da9f00, original_code = ERROR_MARK}) at / Users/pinskia/src/cool/gcc/gcc/c-typeck.c:1372 #1 0x000b8ae4 in c_parser_expression_conv (parser=0x41d9e0c0) at /Users/pinskia/src/cool/gcc/ gcc/c-parser.c:5338 #2 0x000b3898 in c_parser_statement_after_labels (parser=0x41d9e0c0) at /Users/pinskia/src/cool/ gcc/gcc/c-parser.c:3564 #3 0x000b2ee4 in c_parser_compound_statement_nostart (parser=0x41d9e0c0) at /Users/pinskia/ src/cool/gcc/gcc/c-parser.c:3314 #4 0x000b2a58 in c_parser_compound_statement (parser=0x41d9e0c0) at /Users/pinskia/src/cool/ gcc/gcc/c-parser.c:3189 #5 0x000ae994 in c_parser_declaration_or_fndef (parser=0x41d9e0c0, fndef_ok=1 '\001', empty_ok=1 '\001', nested=0 '\0', start_attr_ok=1 '\001') at /Users/pinskia/src/cool/gcc/gcc/c- parser.c:1295 Confirmed. The patch in Comment #1 has been applied. Andrew, what is your point about the C++ front-end? What is it you think is wrong? In any case, this will never be release critical. (In reply to comment #3) > Andrew, what is your point about the C++ front-end? What is it you think is > wrong? There is no mention of the C++ front-end here at all. nnot release critical for GCC-4.0.x Closing 4.1 branch. Still fails in GCC 4.4. My understanding is that this code in fold_builtin_n if (ret) { ret = build1 (NOP_EXPR, TREE_TYPE (ret), ret); => TREE_NO_WARNING (ret) = 1; return ret; } creates a NOP(s), where the NOP tree is marked nowarning. Then, at some moment later, the nowarning is copied to the tree corresponding to s. In my opinion, this is the bug: the nowarning bit should not pass to s. Closing 4.2 branch. GCC 4.3.4 is being released, adjusting target milestone. GCC 4.3.5 is being released, adjusting target milestone. This works for me with GCC 4.6.0 -- [nicola@lampone ~]$ cat x.c #include <string.h> int g(char *); int f(void) { char *s; strcpy(s,s); return g(s); } [nicola@lampone ~]$ gcc x.c -Wall -c -O2 x.c: In function ‘f’: x.c:8:3: warning: ‘s’ is used uninitialized in this function [-Wuninitialized] [nicola@lampone ~]$ The same doesn't work with GCC 4.1.2, where the same gcc command generates no warnings at all. So it looks like the problem has been fixed :-) Thanks |