[all-commits] [llvm/llvm-project] f3d603: [Clang][OpenMP] Fix crash on `safelen` and `simdle...

Akash Manna via All-commits all-commits at lists.llvm.org
Sat Oct 3 09:09:59 PDT 2026


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: f3d6035cc9484ffb55c55e9c9702cf40106cfd6d
      https://github.com/llvm/llvm-project/commit/f3d6035cc9484ffb55c55e9c9702cf40106cfd6d
  Author: Akash Manna <akash.manna.mymail at gmail.com>
  Date:   2026-10-03 (Sat, 03 Oct 2026)

  Changed paths:
    M clang/docs/ReleaseNotes.md
    M clang/lib/Sema/SemaOpenMP.cpp
    M clang/test/OpenMP/simd_misc_messages.c

  Log Message:
  -----------
  [Clang][OpenMP] Fix crash on `safelen` and `simdlen` of different types (#228700)

Fixes #108367

When a `simd` directive has both `safelen` and `simdlen`, Sema checks
that `simdlen` is not greater than `safelen`. It compared the two values
with `APSInt`'s `operator>`, which needs both operands to have the same
bit width and signedness. But each clause keeps its argument in the type
it was written with, so in `safelen(11111111111) simdlen(1)` one value
is 64 bits wide and the other 32, and the comparison asserted. Mixed
signedness, as in `safelen(8u) simdlen(4)`, hit a second assertion on
the same line. A build without assertions rejected the valid code
instead, as if `simdlen` were the larger value.

The check now uses `APSInt::compareValues`, which extends the operands
to a common width and handles mixed signedness, so the values themselves
are compared. The error is still emitted whenever `simdlen` is larger
than `safelen`.



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list