https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97294
--- Comment #7 from CVS Commits <cvs-commit at gcc dot gnu.org> --- The releases/gcc-9 branch has been updated by Jakub Jelinek <ja...@gcc.gnu.org>: https://gcc.gnu.org/g:2913a8f35b7100e8632d2c10dc4126a636cbc9d9 commit r9-9389-g2913a8f35b7100e8632d2c10dc4126a636cbc9d9 Author: Jakub Jelinek <ja...@redhat.com> Date: Thu Oct 8 11:10:34 2020 +0200 openmp: Set cfun->calls_alloca when needed in OpenMP outlined regions [PR97294] The following testcase FAILs, because we don't mark the child OpenMP function as cfun->calls_alloca when it does call alloca. When optimizing, during DCE we reset those flags and recompute them again, but with -O0 DCE is not performed. Fixed by calling notice_special_calls when moving insns to the child function. cfun->calls_alloca is normally set during gimplification and most of the alloca calls omp-low.c does go through the gimplifier, but one spot didn't and built the gcall directly, so that one needs to set calls_alloca too. 2020-10-08 Jakub Jelinek <ja...@redhat.com> PR sanitizer/97294 * tree-cfg.c (move_block_to_fn): Call notice_special_calls on call stmts being moved into dest_cfun. * omp-low.c (lower_rec_input_clauses): Set cfun->calls_alloca when adding __builtin_alloca_with_align call without gimplification. * gcc.dg/asan/pr97294.c: New test. (cherry picked from commit a30fcfb3b848e4b895cb47378b4a250184af3afe)