Skip to content

Commit 94b3c19

Browse files
authored
[M68k][clang] Enable frame pointer optimization by default (llvm#87264)
Enable frame pointer optimization by default to match it with gcc. Fixes: llvm#75013
1 parent aef2810 commit 94b3c19

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

clang/lib/Driver/ToolChains/CommonArgs.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,7 @@ static bool useFramePointerForTargetByDefault(const llvm::opt::ArgList &Args,
114114
case llvm::Triple::csky:
115115
case llvm::Triple::loongarch32:
116116
case llvm::Triple::loongarch64:
117+
case llvm::Triple::m68k:
117118
return !clang::driver::tools::areOptimizationsEnabled(Args);
118119
default:
119120
break;

clang/test/Driver/frame-pointer-elim.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,12 @@
125125
// RUN: %clang -### -target sparc64 -S -O1 %s 2>&1 | \
126126
// RUN: FileCheck --check-prefix=KEEP-NONE %s
127127

128+
// M68k targets omit the frame pointer when optimizations are enabled.
129+
// RUN: %clang -### -target m68k -S %s 2>&1 | \
130+
// RUN: FileCheck --check-prefix=KEEP-ALL %s
131+
// RUN: %clang -### -target m68k -S -O1 %s 2>&1 | \
132+
// RUN: FileCheck --check-prefix=KEEP-NONE %s
133+
128134
// For AAarch32 (A32, T32) linux targets, default omit frame pointer when
129135
// optimizations are enabled.
130136
// RUN: %clang -### -target arm-linux-gnueabihf- -marm -S %s 2>&1 | \

0 commit comments

Comments
 (0)