This is the mail archive of the gcc-bugs@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]

[Bug sanitizer/80114] New: asan-stack=1 with -fsanitize-address-use-after-scope and stack arrays multiplies code size


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

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