Herman ten Brugge <[EMAIL PROTECTED]> writes: > [...] Finally the question. Is it possible to add this extension to > mudflap so the above problem is found here as well.
It is likely possible. The first one (array embedded in struct, indexed by run-time expression) is tricky. There is IIRC no code that specially handles comparing run-time array indexes with statically-declared bounds. This would require emitting a new comparison block, likely in addition to the current pointer-bounds based one. It may be straightforward, but it would be new code. With many tree-ssa optimizations and some subtle tree flag changes since the original work, some tree-mudflap.c checks have to be re-tuned to avoid eliding checks (and object registrations) where still actually necessary. The second of your two cases you point out sounds like one that could be detected by just such a tweak. Similarly, mudflap could exploit some of the clever ssa analysis such as VRP or alias stuff, which should allow us to elide some checks that the compiler can prove as unnecessary. All these just require an interested programmer with some spare time. (I wish I had enough of the latter.) - FChE