Skip to content

[BUG][Clang][AArch64] LLVM backend error: Invalid size request on a scalable vector. #96156

Open
@toor1245

Description

@toor1245

The Clang compiler, LLVM reports error "fatal error: error in backend: Invalid size request on a scalable vector." starting from version 17.0.1 with the following compiler options:

-march=armv9-a and higher (armv9.1-a, armv9.2-a, armv9.3-a and so on) and -mstrict-align and optimization flags like -Os, -O2

Notes when it works successfully:

armv8-a clang (trunk) - Failed

armv8-a clang 18.1.0 - Failed

armv8-a clang 17.0.1 - Failed

armv8-a clang 16.0.0 - No problem

Steps to reproduce the issue.

#include <stdint.h>
#include <stdlib.h>

uint64_t *InvalidSizeRequestOnScalableVector()
{
    uint64_t value = 30;
    uint64_t array_size = 128;
    uint64_t *array = (uint64_t *) malloc(sizeof(uint64_t) * array_size);

    for (unsigned long i = 0; i < array_size; i++)
    {
        array[i] = value;
    }

    return array;
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    backend:AArch64crashPrefer [crash-on-valid] or [crash-on-invalid]

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions