https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80114
Bug ID: 80114 Summary: asan-stack=1 with -fsanitize-address-use-after-scope and stack arrays multiplies code size Product: gcc Version: unknown Status: UNCONFIRMED Severity: normal Priority: P3 Component: sanitizer Assignee: unassigned at gcc dot gnu.org Reporter: jani.nikula at intel dot com CC: dodji at gcc dot gnu.org, dvyukov at gcc dot gnu.org, jakub at gcc dot gnu.org, kcc at gcc dot gnu.org Target Milestone: --- Compiling int main(void) { volatile int i = (const int []){0, 1, 2, 3, 4, 5}[1]; const int j = (const int []){0, 1, 2, 3, 4, 5}[i]; return j; } with --param asan-stack=1 and -fsanitize-address-use-after-scope doubles generated code size. Compared to to the very tightly optimized non-asan code size, this seems pretty bad. Is this to be expected? Comparison: https://godbolt.org/g/hgS817