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]

Re: support array bounds checking


Hello,

I just implemented the hybrid implementation suggested by Per Bothner
in my version of bounds checking for gcc. This version is present at

http://web.inter.NL.net/hcc/Haj.Ten.Brugge/bounds-checking-egcs-1.1.2-1.02.tar.gz

I started implementing on last friday so there may be errors in the
current release. I also have to optimize some more things. I did allready
implement some small improvements. I also found a small problem when
invalidating chunks. The assigment 'P1 = P2' should be rewritten as
'P1$chunk = UNKNOWN_CHUNK, P1 = P2'. There is a problem when P2 uses P2$chunk.
So I rewrote this as 'tmp = (P1 = P2), P1$chunk = UNKNOWN_CHUNK, tmp'.
I did the same for invalidating pointer operations.

The effect of these patches are faster bounds-checking code. I have to
repeat some tests from Richard Jones to check how much faster the code
really is. There will allways be a slowdown of about a factor 4 to 5 
because we have to validate every pointer operation. A slowdown of
50 as mentioned in Richard Jones report will probably not occur anymore
because of this hybrid implementation.

	Herman.


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