This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
pointer checking run time code
- From: shreyas krishnan <shreyas76 at gmail dot com>
- To: gcc at gcc dot gnu dot org
- Date: Sat, 17 Sep 2005 13:41:42 +0000
- Subject: pointer checking run time code
- Reply-to: shreyas76 at gmail dot com
Hi all,
I am trying to insert code which before pointer dereferences
would check if the pointer dereference is valid. As this might mean a
lot of overhead, I was wondering where would be the best place to
insert it so that the overhead can be opitimized away. Especially, I
was wondering if any optimization would hoist the check outside loops.
Can I inline it and hope some code will get hoisted ? Or do I have to
do it explicitly ? The check is likely to be a function call that
checks the pointer values against some bounds.
Ideas, other pointers would be great
Shrey