From gcc-patches Sat Jan 13 19:40:40 2007 From: Dirk Mueller Date: Sat, 13 Jan 2007 19:40:40 +0000 To: gcc-patches Subject: Re: [C PATCH] Simple compile-time array bounds checking Message-Id: <200701132040.40831.dmuell () gmx ! net> X-MARC-Message: https://marc.info/?l=gcc-patches&m=116871724725452 On Saturday, 13. January 2007 16:48, Roger Sayle wrote: > One extension of your approach may be also add/re-use your code during > gimplification or the front-ends. Many of cases you're trying to catch, > including the f() examples listed in PR 8268, don't require VRP to > propagate constants into array indices, and hence can be emitted even with > -O1 or -O0, and perhaps even -fsyntax-only. In fact, I've tried that and it seems to fail miserably in practice. The reason for that is dead code (expanded for example from glibc #define's) producing out of bounds accesses and triggering many false warnings. This happens almost everywhere, to the level of making the warning unusable. Dirk