http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46143
--- Comment #6 from Jonathan Wakely 2010-10-23
15:14:49 UTC ---
my test in comment 3 passes the assertion on trunk, but fails with 4.5.2
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46143
Richard Guenther changed:
What|Removed |Added
CC||rguenth at gcc dot gnu.org
--- Comment
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46143
--- Comment #4 from Ryan Johnson 2010-10-22 23:06:53
UTC ---
As I said, the stack smashing was only there to make the behavior consistent.
If the offending stack location happens to contain zero, the bug would go
unnoticed (try adding 'long n[1]'
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46143
--- Comment #3 from Jonathan Wakely 2010-10-22
22:53:17 UTC ---
here's one which avoids invalid iterators and stack smashing:
#include
#include
struct foo { };
typedef std::vector foov;
foov v(1);
int
#ifdef BUG
__attribute__((optimize(0))
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46143
--- Comment #2 from Jonathan Wakely 2010-10-22
22:47:09 UTC ---
that program has two kinds of undefined behaviour I can see
not only do two wrongs not make a right, but attribute((optimize(0))) doesn't
make it right either
do you have a testcas
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46143
Ryan Johnson changed:
What|Removed |Added
Attachment #22129|0 |1
is obsolete|