Skip to content

Conversation

@dpaoliello
Copy link
Contributor

Some targets, such as aarch64-pc-windows-msvc, always require that Frame Pointer be reserved even when -fomit-frame-pointer is provided, thus it is always valid to use -pg on those targets.

This test didn't take these targets into account; thus it was failing on Arm64 Windows host machines.

The fix is to explicitly set a target that doesn't require Frame Pointers reservation.

@dpaoliello dpaoliello requested a review from luporl July 10, 2025 16:57
@llvmbot llvmbot added clang Clang issues not falling into any other category clang:driver 'clang' and 'clang++' user-facing binaries. Not 'clang-cl' labels Jul 10, 2025
@llvmbot
Copy link
Member

llvmbot commented Jul 10, 2025

@llvm/pr-subscribers-clang

@llvm/pr-subscribers-clang-driver

Author: Daniel Paoliello (dpaoliello)

Changes

Some targets, such as aarch64-pc-windows-msvc, always require that Frame Pointer be reserved even when -fomit-frame-pointer is provided, thus it is always valid to use -pg on those targets.

This test didn't take these targets into account; thus it was failing on Arm64 Windows host machines.

The fix is to explicitly set a target that doesn't require Frame Pointers reservation.


Full diff: https://github.com/llvm/llvm-project/pull/148000.diff

1 Files Affected:

  • (modified) clang/test/Driver/frame-pointer-elim.c (+2-2)
diff --git a/clang/test/Driver/frame-pointer-elim.c b/clang/test/Driver/frame-pointer-elim.c
index 0dd7eb0c738db..f00940bd7613d 100644
--- a/clang/test/Driver/frame-pointer-elim.c
+++ b/clang/test/Driver/frame-pointer-elim.c
@@ -44,8 +44,8 @@
 // RUN:   FileCheck --check-prefix=KEEP-NONE %s
 
 // -pg -fomit-frame-pointer => error.
-// RUN: not %clang -### -S -fomit-frame-pointer -pg %s 2>&1 | FileCheck -check-prefix=CHECK-NO-MIX-OMIT-FP-PG %s
-// RUN: %clang -### -S -fomit-frame-pointer -fno-omit-frame-pointer -pg %s 2>&1 | FileCheck -check-prefix=CHECK-MIX-NO-OMIT-FP-PG %s
+// RUN: not %clang -### --target=i386-linux -S -fomit-frame-pointer -pg %s 2>&1 | FileCheck -check-prefix=CHECK-NO-MIX-OMIT-FP-PG %s
+// RUN: %clang -### --target=i386-linux -S -fomit-frame-pointer -fno-omit-frame-pointer -pg %s 2>&1 | FileCheck -check-prefix=CHECK-MIX-NO-OMIT-FP-PG %s
 // CHECK-NO-MIX-OMIT-FP-PG: '-fomit-frame-pointer' not allowed with '-pg'
 // CHECK-MIX-NO-OMIT-FP-PG-NOT: '-fomit-frame-pointer' not allowed with '-pg'
 

Copy link
Contributor

@luporl luporl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks.
I tested it on a Windows on ARM machine and it worked fine.

@dpaoliello dpaoliello merged commit c92d5da into llvm:main Jul 10, 2025
11 of 12 checks passed
@dpaoliello dpaoliello deleted the pgusearch branch July 10, 2025 17:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

clang:driver 'clang' and 'clang++' user-facing binaries. Not 'clang-cl' clang Clang issues not falling into any other category

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants