public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
From: Martin Liska <marxin@gcc.gnu.org>
To: gcc-cvs@gcc.gnu.org
Subject: [gcc(refs/users/marxin/heads/rs6000-ibmlongdouble)] rs6000: Fix restored rs6000_long_double_type_size.
Date: Mon, 28 Jun 2021 12:20:24 +0000 (GMT)	[thread overview]
Message-ID: <20210628122024.9606F3980834@sourceware.org> (raw)

https://gcc.gnu.org/g:1632939853fbf193f72ace3d1024a137d549fef4

commit 1632939853fbf193f72ace3d1024a137d549fef4
Author: Martin Liska <mliska@suse.cz>
Date:   Tue Jun 1 15:39:14 2021 +0200

    rs6000: Fix restored rs6000_long_double_type_size.
    
    gcc/ChangeLog:
    
            * config/rs6000/rs6000.c (rs6000_option_override_internal): When
            a target option is restored, it can have
            rs6000_long_double_type_size set to FLOAT_PRECISION_TFmode.
    
    gcc/testsuite/ChangeLog:
    
            * gcc.target/powerpc/pragma-optimize.c: New test.

Diff:
---
 gcc/config/rs6000/rs6000.c                         |  2 ++
 gcc/testsuite/gcc.target/powerpc/pragma-optimize.c | 14 ++++++++++++++
 2 files changed, 16 insertions(+)

diff --git a/gcc/config/rs6000/rs6000.c b/gcc/config/rs6000/rs6000.c
index 2c249e186e1..fa4aa864c00 100644
--- a/gcc/config/rs6000/rs6000.c
+++ b/gcc/config/rs6000/rs6000.c
@@ -4185,6 +4185,8 @@ rs6000_option_override_internal (bool global_init_p)
       else
 	rs6000_long_double_type_size = default_long_double_size;
     }
+  else if (rs6000_long_double_type_size == FLOAT_PRECISION_TFmode)
+    ; /* The option can be restored with cl_target_option_restore.  */
   else if (rs6000_long_double_type_size == 128)
     rs6000_long_double_type_size = FLOAT_PRECISION_TFmode;
   else if (global_options_set.x_rs6000_ieeequad)
diff --git a/gcc/testsuite/gcc.target/powerpc/pragma-optimize.c b/gcc/testsuite/gcc.target/powerpc/pragma-optimize.c
new file mode 100644
index 00000000000..2455fb57138
--- /dev/null
+++ b/gcc/testsuite/gcc.target/powerpc/pragma-optimize.c
@@ -0,0 +1,14 @@
+/* { dg-do compile { target { powerpc*-*-* } } } */
+/* { dg-options "-O2 -mlong-double-128 -mabi=ibmlongdouble" } */
+
+extern unsigned long int x;
+extern float f (float);
+extern __typeof (f) f_power8;
+extern __typeof (f) f_power9;
+extern __typeof (f) f __attribute__ ((ifunc ("f_ifunc")));
+static __attribute__ ((optimize ("-fno-stack-protector"))) __typeof (f) *
+f_ifunc (void)
+{
+  __typeof (f) *res = x ? f_power9 : f_power8;
+  return res;
+}


             reply	other threads:[~2021-06-28 12:20 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-28 12:20 Martin Liska [this message]
  -- strict thread matches above, loose matches on Subject: below --
2021-08-05 12:04 Martin Liska
2021-06-01 13:40 Martin Liska

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=20210628122024.9606F3980834@sourceware.org \
    --to=marxin@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: link
Be 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).