Skip to content

#pragma GCC unroll 0 not allowed: invalid value '0'; must be positive #88624

@MonsterDruide1

Description

@MonsterDruide1

#pragma GCC unroll 0 does not compile, as apparently the specified number needs to be positive.

/app/main.cpp:4:24: error: invalid value '0'; must be positive
    4 |     #pragma GCC unroll 0
      |                        ^
1 error generated.

However, from https://gcc.gnu.org/onlinedocs/gcc/Loop-Specific-Pragmas.html:

The values of 0 and 1 block any unrolling of the loop.

The program also successfully compiles with GCC, only clang seems to have this implemented incorrectly.

Godbolt: https://godbolt.org/z/bEPo64GsP

Metadata

Metadata

Assignees

Labels

clang:frontendLanguage frontend issues, e.g. anything involving "Sema"extension:gnu

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions