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]

RFC: pass to warn on questionable uses of alloca().


Hi folks!

I've been working on a plugin to warn on unbounded uses of alloca() to help find questionable uses in glibc and other libraries. It occurred to me that the broader community could benefit from it, as it has found quite a few interesting cases. So, I've reimplemented it as an actual pass, lest it be lost in plugin la-la land and bit-rot.

Before I sink any more time cleaning it up, would this be something acceptable into the compiler? It doesn't have anything glibc specific, except possibly the following idiom which I allow:

    if (gate_function (length))
        alloca(length);

...and the above is probably common enough that we should handle it.

The testcase has a lot of examples of what the pass handles.

Thoughts?

Aldy

p.s. The pass currently warns on all uses of VLAs. I'm not completely sold on this idea, so perhaps we could remove it, or gate it with a flag.

Attachment: curr
Description: Text document


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