http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57073
--- Comment #9 from Tobias Burnus <burnus at gcc dot gnu.org> 2013-05-03 09:58:20 UTC --- After some discussion with Jakub and Richard - and after doing some code reads, I think it is best do handle this in tree-ssa-math-opts.c (search for gimple_expand_builtin_powi and BUILT_IN_POWI). For the code insertion, asan.c's build_check_stmt can serve as template.