w.h: #pragma GCC system_header typedef __SIZE_TYPE__ size_t; extern void *memset (void *__s, int __c, size_t __n) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))); extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__artificial__)) void * __attribute__ ((__nothrow__)) memset (void *__dest, int __ch, size_t __len) { return __builtin___memset_chk (__dest, __ch, __len, __builtin_object_size (__dest, 0)); } w.c: #include "w.h" static inline void test (char *p) { memset (p, 0, 6); } int main (void) { char buf[4]; test (buf); memset (buf, 0, 6); return 0; } gcc 4.3 used to emit 2 warnings, gcc 4.4 and trunk only one (but both 4.3 and 4.4+ emit two __memset_chk calls that will always __chk_fail at runtime).
r138031 broke it altogether (no warnings were emitted at all), PR39272 made at least one of the two warnings reappear.
4.3 reported (with -O2 -Wall): In function 'memset', inlined from 'main' at w.c:6: w.h:11: warning: call to __builtin___memset_chk will always overflow destination buffer In function 'memset', inlined from 'main' at w.c:14: w.h:11: warning: call to __builtin___memset_chk will always overflow destination buffer 4.4 reports: In file included from w.c:1: w.h: In function 'main': w.h:11: warning: call to __builtin___memset_chk will always overflow destination buffer and with -O2 -Wall -Wsystem-headers: In file included from w.c:1: w.h: In function 'main': w.h:11: warning: call to __builtin___memset_chk will always overflow destination buffer w.h:11: warning: call to __builtin___memset_chk will always overflow destination buffer
Subject: Bug 40340 Author: jakub Date: Fri Jun 5 15:35:13 2009 New Revision: 148212 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=148212 Log: PR middle-end/40340 * tree-ssa-live.c (remove_unused_scope_block_p): Don't prune inlined_function_outer_scope_p blocks for artificial inlines even at -g0/-g1. * tree.c (tree_nonartificial_location): Rewrite using block_nonartificial_location. * gcc.dg/pr40340-1.c: New test. * gcc.dg/pr40340-2.c: New test. * gcc.dg/pr40340-3.c: New test. * gcc.dg/pr40340-4.c: New test. * gcc.dg/pr40340-5.c: New test. * gcc.dg/pr40340.h: New file. Added: trunk/gcc/testsuite/gcc.dg/pr40340-1.c trunk/gcc/testsuite/gcc.dg/pr40340-2.c trunk/gcc/testsuite/gcc.dg/pr40340-3.c trunk/gcc/testsuite/gcc.dg/pr40340-4.c trunk/gcc/testsuite/gcc.dg/pr40340-5.c trunk/gcc/testsuite/gcc.dg/pr40340.h Modified: trunk/gcc/ChangeLog trunk/gcc/tree-ssa-live.c trunk/gcc/tree.c
Subject: Bug 40340 Author: jakub Date: Fri Jun 5 16:31:44 2009 New Revision: 148214 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=148214 Log: PR middle-end/40340 * tree-ssa-live.c (remove_unused_scope_block_p): Don't prune inlined_function_outer_scope_p blocks for artificial inlines even at -g0/-g1. * tree.c (tree_nonartificial_location): Rewrite using block_nonartificial_location. * gcc.dg/pr40340-1.c: New test. * gcc.dg/pr40340-2.c: New test. * gcc.dg/pr40340-3.c: New test. * gcc.dg/pr40340-4.c: New test. * gcc.dg/pr40340-5.c: New test. * gcc.dg/pr40340.h: New file. Added: branches/gcc-4_4-branch/gcc/testsuite/gcc.dg/pr40340-1.c branches/gcc-4_4-branch/gcc/testsuite/gcc.dg/pr40340-2.c branches/gcc-4_4-branch/gcc/testsuite/gcc.dg/pr40340-3.c branches/gcc-4_4-branch/gcc/testsuite/gcc.dg/pr40340-4.c branches/gcc-4_4-branch/gcc/testsuite/gcc.dg/pr40340-5.c branches/gcc-4_4-branch/gcc/testsuite/gcc.dg/pr40340.h Modified: branches/gcc-4_4-branch/gcc/ChangeLog branches/gcc-4_4-branch/gcc/testsuite/ChangeLog branches/gcc-4_4-branch/gcc/tree-ssa-live.c branches/gcc-4_4-branch/gcc/tree.c
Subject: Bug 40340 Author: jakub Date: Fri Jun 5 16:32:21 2009 New Revision: 148215 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=148215 Log: Fix up ChangeLog entries for PR middle-end/40340 Modified: trunk/gcc/ChangeLog trunk/gcc/testsuite/ChangeLog
Fixed.