aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorChristophe Lyon <christophe.lyon@linaro.org>2024-10-03 13:37:16 +0000
committerChristophe Lyon <christophe.lyon@linaro.org>2024-11-15 12:56:02 +0000
commita064fed18a02696586cd8c182fd56c571c9438c1 (patch)
treeef8f1205f9d933d05e815cfead3292759c410395 /gcc
parent5a2c3a69fbdcb56a1d21d340d3b9fb5a9b68b717 (diff)
downloadgcc-a064fed18a02696586cd8c182fd56c571c9438c1.zip
gcc-a064fed18a02696586cd8c182fd56c571c9438c1.tar.gz
gcc-a064fed18a02696586cd8c182fd56c571c9438c1.tar.bz2
testsuite: Fix tail_call and musttail effective targets [PR116080]
Some of the musttail tests (eg musttail7.c) fail on arm-eabi because check_effective_target_musttail pass, but the actual code in the test is rejected. The reason is that on arm-eabi with the default configuration, the compiler targets armv4t for which TARGET_INTERWORK is true, making arm_function_ok_for_sibcall reject a tail-call candidate if TREE_ASM_WRITTEN (decl) is false. For more recent architecture versions, TARGET_INTERWORK is false, hence the problem was not seen on all arm configurations. musttail7.c is in turn rejected because f2 is recursive, so TREE_ASM_WRITTEN is false. However, the same code used in check_effective_target_musttail is not recursive and the function body for foo has TREE_ASM_WRITTEN == true. The simplest fix is to remove the (empty) body for foo () in check_effective_target_musttail. For consistency, do the same with check_effective_target_tail_call. gcc/testsuite/ChangeLog: PR testsuite/116080 * lib/target-supports.exp (check_effective_target_tail_call): Remove foo's body. (check_effective_target_musttail): Likewise.
Diffstat (limited to 'gcc')
-rw-r--r--gcc/testsuite/lib/target-supports.exp4
1 files changed, 2 insertions, 2 deletions
diff --git a/gcc/testsuite/lib/target-supports.exp b/gcc/testsuite/lib/target-supports.exp
index fd58682..e13c138 100644
--- a/gcc/testsuite/lib/target-supports.exp
+++ b/gcc/testsuite/lib/target-supports.exp
@@ -12987,7 +12987,7 @@ proc check_effective_target_frame_pointer_for_non_leaf { } {
# most trivial type.
proc check_effective_target_tail_call { } {
return [check_no_messages_and_pattern tail_call ",SIBCALL" rtl-expand {
- __attribute__((__noipa__)) void foo (void) { }
+ __attribute__((__noipa__)) void foo (void);
__attribute__((__noipa__)) void bar (void) { foo(); }
} {-O2 -fdump-rtl-expand-all}] ;# The "SIBCALL" note requires a detailed dump.
}
@@ -12997,7 +12997,7 @@ proc check_effective_target_tail_call { } {
# is supported at -O0.
proc check_effective_target_musttail { } {
return [check_no_messages_and_pattern musttail ",SIBCALL" rtl-expand {
- __attribute__((__noipa__)) void foo (void) { }
+ __attribute__((__noipa__)) void foo (void);
__attribute__((__noipa__)) void bar (void) { [[gnu::musttail]] return foo(); }
} {-fdump-rtl-expand-all}] ;# The "SIBCALL" note requires a detailed dump.
}