[flang-commits] [flang] [flang] Fix -debug crash from VScaleAttrPass (PR #180234)

Benjamin Maxwell via flang-commits flang-commits at lists.llvm.org
Mon Feb 9 02:07:41 PST 2026


================
@@ -63,16 +66,29 @@ void VScaleAttrPass::runOnOperation() {
 
   LLVM_DEBUG(llvm::dbgs() << "Func-name:" << func.getSymName() << "\n");
 
+  if (!llvm::isPowerOf2_32(vscaleMin)) {
+    LLVM_DEBUG(
+        llvm::dbgs()
+        << "VScaleAttr: vscaleMin has to be a power-of-two greater than 0\n");
+    return;
----------------
MacDue wrote:

Would it be better to signal a pass failure here? 
```suggestion
     func->emitError("VScaleAttr: vscaleMin has to be a power-of-two greater than 0");
     return signalPassFailure();
```

https://github.com/llvm/llvm-project/pull/180234


More information about the flang-commits mailing list