http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49279
--- Comment #14 from Richard Guenther <rguenth at gcc dot gnu.org> 2011-10-06 08:09:51 UTC --- (In reply to comment #11) > Created attachment 25423 [details] > CAST_RESTRICT removal > > Attaching a test patch that just removed CAST_RESTRICT altogether, plus IRC > discussion that lead to it. The only testsuite regressions are Wobjsize-1.c > and strlenopt-4gf.c which show an important security related problem - we > probably shouldn't be folding builtins if DECL_INITIAL (fndecl) != NULL && > DECL_DECLARED_INLINE_P (fndecl) && cfun && !cfun->after_inlining, > because then we happily fold e.g. char buf[2]; strcpy (buf, "abcd"); into > __builtin_memcpy even when strcpy is always_inline inline wrapper that calls > __builtin___strcpy_chk and would complain about the buffer overflow resp. add > runtime checking. The patch looks ok to me once we solved the folding issue (we probably have to backport that as well then).