Skip to content

memset not generated for ** array zero-initialization #51485

@llvmbot

Description

@llvmbot
Bugzilla Link 52143
Version trunk
OS Linux
Reporter LLVM Bugzilla Contributor
CC @davidbolvansky,@DMG862,@dwblaikie,@fhahn

Extended Description

clang at -O2 missed opportunity to generate memset for

unsigned** a;
void foo( int max )
{
  for (int i = 0; i <= max; ++i) 
  {
    a[i] = 0;
  }
}

and left the loop, while gcc succeeded to do this:
X86-64 https://godbolt.org/z/oK59vf66n
AArch64 https://godbolt.org/z/G53W1vz7W

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions