Caveat: GCC-based analysis unreliable for Free Software
Posted Jan 27, 2010 16:19 UTC (Wed) by
jzbiciak (
✭ supporter ✭, #5246)
In reply to:
Caveat: GCC-based analysis unreliable for Free Software by pjm
Parent article:
LCA: Static analysis with GCC plugins
(ii) By using less of gcc, there's more work for the analysis code to do. For example, you need to work out what all the valid evaluation orders are,
You just need to scan the list once and work out if any of the arguments have side effects. If two arguments have side effects on objects that may alias (and I imagine you can consult GCC's alias analysis to get a "YES/MAYBE/NO" answer), throw a warning.
That doesn't require generating and analyzing all N! potential orderings among N arguments. It just requires an O(M2) loop to check pairwise for all pairs, where M is the number arguments with side effects. M is generally rather small, too.
And I'd hope GCC has functions to help you find the arguments with side effects.
(
Log in to post comments)