This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [C PATCH] Simple compile-time array bounds checking
- From: Dirk Mueller <dmuell at gmx dot net>
- To: gcc-patches at gcc dot gnu dot org
- Cc: "Roger Sayle" <roger at eyesopen dot com>, joseph at codesourcery dot com
- Date: Sat, 13 Jan 2007 13:53:27 +0100
- Subject: Re: [C PATCH] Simple compile-time array bounds checking
- References: <15713.68.35.10.103.1168666595.squirrel@mail.eyesopen.com>
On Saturday, 13. January 2007 06:36, Roger Sayle wrote:
> My apologies if this is a frequently contributed patch
:)
The patch in http://gcc.gnu.org/ml/gcc-patches/2006-12/msg01523.html was
approved in http://gcc.gnu.org/ml/gcc-patches/2006-12/msg01703.html by
Richard Guenther. It is my lazyness (a complete bootstrap+regtest takes me
more than 24 hours) that I haven't committed the patch yet. I also wanted to
address Richards concern to only enable the struct hack in sensible cases,
although this could be done in a followup patch.
> Thoughts? Ok for mainline?
I've tested it, and it seems to fail on:
int a[10];
int* f(void) {
a[10] = 0;
return a;
}
And a couple of other cases that are linked in the testcase that is attached
to above URL. Also, it is not working for the C++ frontend, while the VRP
based solution workes for C and C++ (and can be enabled for other frontends
as well in followup patches).
Would you mind commenting on why you think the patch I posted is a bad idea or
would you mind if I go ahead and commit it after a regtest (just started it
again, might complete before monday)?
Thanks,
Dirk