This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [C PATCH] Simple compile-time array bounds checking


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]