aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-if-conv.c
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2020-08-06 14:12:21 +0930
committerAlan Modra <amodra@gmail.com>2020-08-07 10:31:52 +0930
commitf8ac30f1653ff69706c35af6d725f1d330600f11 (patch)
treebc8e853f0e4a4a743d325d3fe9fdf005830e0ad0 /gcc/tree-if-conv.c
parent74d91e8bb7935c1bf57fbc26437935eeee00d238 (diff)
downloadgcc-f8ac30f1653ff69706c35af6d725f1d330600f11.zip
gcc-f8ac30f1653ff69706c35af6d725f1d330600f11.tar.gz
gcc-f8ac30f1653ff69706c35af6d725f1d330600f11.tar.bz2
PR96493, powerpc local call linkage failure
This corrects current_file_function_operand, an operand predicate used to determine whether a symbol_ref is safe to use with the local_call patterns. Calls between pcrel and non-pcrel code need to go via linker stubs. In the case of non-pcrel code to pcrel the stub saves r2 but there needs to be a nop after the branch for the r2 restore. So the local_call patterns can't be used there. For pcrel code to non-pcrel the local_call patterns could still be used, but I thought it better to not use them since the call isn't direct. Code generated by the corresponding call_nonlocal_aix for pcrel is identical anyway. Incidentally, without the TREE_CODE () == FUNCTION_DECL test, gcc.c-torture/compile/pr37433.c and pr37433-1.c ICE. Also, if you make the test more strict by disallowing an op without a SYMBOL_REF_DECL then a bunch of go and split-stack tests fail. That's because a prologue call to __morestack can't have a following nop. (__morestack calls its caller at a fixed offset from the __morestack call!) gcc/ PR target/96493 * config/rs6000/predicates.md (current_file_function_operand): Don't accept functions that differ in r2 usage. gcc/testsuite/ * gcc.target/powerpc/pr96493.c: New file.
Diffstat (limited to 'gcc/tree-if-conv.c')
0 files changed, 0 insertions, 0 deletions