[flang-commits] [flang] [flang] Do not honor -fstack-arrays inside offload regions (PR #227537)

via flang-commits flang-commits at lists.llvm.org
Wed Sep 30 02:07:34 PDT 2026


================
@@ -152,6 +154,10 @@ void AllocationPlacementPass::runOnOperation() {
                                smallArrayThresholdBytes);
   fir::overrideIfExplicitlySet(basePolicy.totalStackLimitBytes,
                                totalStackLimitBytes);
+  // An acc routine is compiled for the device as well, so -fstack-arrays
+  // cannot be honored in it, as in a device procedure.
+  if (mlir::acc::isAccRoutine(func))
+    basePolicy.stackArrays = false;
----------------
jeanPerier wrote:

Why not setting the allocation policy with stack array = false on the acc routine directly so that the policy obtained with ` fir::getLocalAllocationPolicy` is correct?

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


More information about the flang-commits mailing list