public inbox for gcc-cvs@sourceware.org help / color / mirror / Atom feed
From: Michael Meissner <meissner@gcc.gnu.org> To: gcc-cvs@gcc.gnu.org Subject: [gcc(refs/users/meissner/heads/work078)] Reset -mpower8-fusion for inline test, PR 102059. Date: Tue, 8 Feb 2022 21:43:38 +0000 (GMT) [thread overview] Message-ID: <20220208214338.61A633858D20@sourceware.org> (raw) https://gcc.gnu.org/g:4015918720331c0379564313ab8461b559737e96 commit 4015918720331c0379564313ab8461b559737e96 Author: Michael Meissner <meissner@linux.ibm.com> Date: Tue Feb 8 16:43:15 2022 -0500 Reset -mpower8-fusion for inline test, PR 102059. 2022-02-08 Michael Meissner <meissner@linux.ibm.com> gcc/ PR target/102059 * config/rs6000/rs6000.cc (rs6000_can_inline_p): Don't test for power8-fusion if the caller was power9 or power10. gcc/testsuite/ PR target/102059 * gcc.target/powerpc/pr102059-4.c: New test. Diff: --- gcc/config/rs6000/rs6000.cc | 8 ++++++++ gcc/testsuite/gcc.target/powerpc/pr102059-4.c | 20 ++++++++++++++++++++ 2 files changed, 28 insertions(+) diff --git a/gcc/config/rs6000/rs6000.cc b/gcc/config/rs6000/rs6000.cc index eaba9a2d698..e2d94421ae9 100644 --- a/gcc/config/rs6000/rs6000.cc +++ b/gcc/config/rs6000/rs6000.cc @@ -25278,6 +25278,14 @@ rs6000_can_inline_p (tree caller, tree callee) callee_isa &= ~OPTION_MASK_HTM; explicit_isa &= ~OPTION_MASK_HTM; } + + /* Power9 and power10 do not set power8-fusion. If the callee was + explicitly compiled for power8, and the caller was power9 or + power10, ignore the power8-fusion bits if it was set by + default. */ + if ((caller_isa & OPTION_MASK_P8_FUSION) == 0 + && (explicit_isa & OPTION_MASK_P8_FUSION) == 0) + callee_isa &= ~OPTION_MASK_P8_FUSION; } /* The callee's options must be a subset of the caller's options, i.e. diff --git a/gcc/testsuite/gcc.target/powerpc/pr102059-4.c b/gcc/testsuite/gcc.target/powerpc/pr102059-4.c new file mode 100644 index 00000000000..627c6f820c7 --- /dev/null +++ b/gcc/testsuite/gcc.target/powerpc/pr102059-4.c @@ -0,0 +1,20 @@ +/* { dg-do compile } */ +/* { dg-options "-O2 -mdejagnu-cpu=power10 -Wno-attributes" } */ + +/* Verify that power10 can explicity include functions compiled for power8. + The issue is -mcpu=power8 enables -mpower8-fusion, but -mcpu=power9 or + -mcpu=power10 do not set power8-fusion by default. */ + +static inline int __attribute__ ((always_inline,target("cpu=power8"))) +foo (int *b) +{ + *b += 10; + return *b; +} + +int +bar (int *a) +{ + *a = foo (a); + return 0; +}
reply other threads:[~2022-02-08 21:43 UTC|newest] Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=20220208214338.61A633858D20@sourceware.org \ --to=meissner@gcc.gnu.org \ --cc=gcc-cvs@gcc.gnu.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).