[all-commits] [llvm/llvm-project] aef8a2: [Flang][OpenMP] Fix crash with character types in ...

Krish Gupta via All-commits all-commits at lists.llvm.org
Tue Feb 10 03:31:46 PST 2026


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: aef8a2c483149d4ad2546843350002f11eb48a20
      https://github.com/llvm/llvm-project/commit/aef8a2c483149d4ad2546843350002f11eb48a20
  Author: Krish Gupta <krishom70 at gmail.com>
  Date:   2026-02-10 (Tue, 10 Feb 2026)

  Changed paths:
    M flang/lib/Lower/OpenMP/ClauseProcessor.cpp
    M flang/lib/Lower/OpenMP/OpenMP.cpp
    M flang/lib/Lower/Support/PrivateReductionUtils.cpp
    M flang/lib/Lower/Support/ReductionProcessor.cpp
    A flang/test/Lower/OpenMP/Todo/reduction-character-dynamic-length.f90
    A flang/test/Lower/OpenMP/declare-reduction-character-allocatable.f90

  Log Message:
  -----------
  [Flang][OpenMP] Fix crash with character types in declare_reduction (#178038)

Fixes #177501

This PR fixes a compilation crash when using character types in OpenMP
REDUCTION clauses with declare_reduction directives.

The problem was that character types weren't being handled properly
during OpenMP lowering. Specifically:
- Missing character length parameters in hlfir.declare operations
- Incorrect type wrapping for by-ref reductions
- Missing special case handling for boxed/unboxed character types

The fix ensures character types are treated similarly to derived types
throughout the reduction pipeline, since fir::isa_trivial() excludes
them.

Added a regression test to verify the fix works for both allocatable and
non-allocatable character reductions.
<img width="654" height="47" alt="image"
src="https://github.com/user-attachments/assets/cc962f01-3432-44ce-befb-324644767c8b"
/>



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