diff options
author | CoprDistGit <infra@openeuler.org> | 2024-08-05 01:49:16 +0000 |
---|---|---|
committer | CoprDistGit <infra@openeuler.org> | 2024-08-05 01:49:16 +0000 |
commit | a7b7e4a7981e56c8a7f015a6890a9bc70e77d277 (patch) | |
tree | 22200b7326b32ca672ffb6e4ce6d19a09dc476e5 /gcc48-pr79439.patch | |
parent | 28ea859f51e6ad6daf821902dabb4dec086ab981 (diff) |
automatic import of compat-libgfortran-48openeuler24.03_LTS
Diffstat (limited to 'gcc48-pr79439.patch')
-rw-r--r-- | gcc48-pr79439.patch | 53 |
1 files changed, 53 insertions, 0 deletions
diff --git a/gcc48-pr79439.patch b/gcc48-pr79439.patch new file mode 100644 index 0000000..c593dfc --- /dev/null +++ b/gcc48-pr79439.patch @@ -0,0 +1,53 @@ +2017-03-01 Michael Meissner <meissner@linux.vnet.ibm.com> + + PR target/79439 + * config/rs6000/predicates.md (current_file_function_operand): Do + not allow self calls to be local if the function is replaceable. + + * gcc.target/powerpc/pr79439.c: New test. + +--- gcc/config/rs6000/predicates.md (revision 245812) ++++ gcc/config/rs6000/predicates.md (revision 245813) +@@ -1086,8 +1086,8 @@ + && ((DEFAULT_ABI != ABI_AIX + && DEFAULT_ABI != ABI_ELFv2) + || !SYMBOL_REF_EXTERNAL_P (op))) +- || (op == XEXP (DECL_RTL (current_function_decl), +- 0)))"))) ++ || (op == XEXP (DECL_RTL (current_function_decl), 0) ++ && !decl_replaceable_p (current_function_decl)))"))) + + ;; Return 1 if this operand is a valid input for a move insn. + (define_predicate "input_operand" +--- gcc/testsuite/gcc.target/powerpc/pr79439.c (nonexistent) ++++ gcc/testsuite/gcc.target/powerpc/pr79439.c (revision 245813) +@@ -0,0 +1,29 @@ ++/* { dg-do compile { target { powerpc64*-*-linux* && lp64 } } } */ ++/* { dg-options "-O2 -fpic" } */ ++ ++/* On the Linux 64-bit ABIs, we should not eliminate NOP in the 'rec' call if ++ -fpic is used because rec can be interposed at link time (since it is ++ external), and the recursive call should call the interposed function. The ++ Linux 32-bit ABIs do not require NOPs after the BL instruction. */ ++ ++int f (void); ++ ++void ++g (void) ++{ ++} ++ ++int ++rec (int a) ++{ ++ int ret = 0; ++ if (a > 10 && f ()) ++ ret += rec (a - 1); ++ g (); ++ return a + ret; ++} ++ ++/* { dg-final { scan-assembler-times {\mbl f\M} 1 } } */ ++/* { dg-final { scan-assembler-times {\mbl g\M} 2 } } */ ++/* { dg-final { scan-assembler-times {\mbl rec\M} 1 } } */ ++/* { dg-final { scan-assembler-times {\mnop\M} 4 } } */ |