public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc r13-6383] rs6000: Allow powerpc64 to be unset for implicit 64 bit [PR108240]
@ 2023-03-01  5:19 Kewen Lin
  0 siblings, 0 replies; only message in thread
From: Kewen Lin @ 2023-03-01  5:19 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:392f399ae0595e6b4433c18900cc67991fb140f4

commit r13-6383-g392f399ae0595e6b4433c18900cc67991fb140f4
Author: Kewen Lin <linkw@linux.ibm.com>
Date:   Tue Feb 28 23:17:48 2023 -0600

    rs6000: Allow powerpc64 to be unset for implicit 64 bit [PR108240]
    
    Before r13-4894, if 64 bit is explicitly specified, option
    powerpc64 is explicitly enabled too; while if 64 bit is
    implicitly enabled and there is no explicit setting for
    option powerpc64, option powerpc64 is eventually enabled
    or not would rely on the default value of the used cpu.
    It's initially set as the setting for 64 bit, but later if
    the used cpu doesn't have powerpc64 supported by default,
    it gets cleared.
    
    To keep it consistent with before (also the relevant error/
    warning messages), this patch is to allow that powerpc64
    can be unset if 64 bit is enabled implicitly, and only stop
    it from being unset if 64 bit is enabled explicitly.
    
    Note that since the behaviors are different for implicit
    and explicit 64 bit, I failed to construct one solid test
    case since it becomes fragile once RUNTESTFLAGS specifying
    -m64 explicitly.
    
            PR target/108240
    
    gcc/ChangeLog:
    
            * config/rs6000/rs6000.cc (rs6000_option_override_internal): Allow
            implicit powerpc64 setting to be unset if 64 bit is enabled implicitly.

Diff:
---
 gcc/config/rs6000/rs6000.cc | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/gcc/config/rs6000/rs6000.cc b/gcc/config/rs6000/rs6000.cc
index 16ca3a31757..8e0b0d022db 100644
--- a/gcc/config/rs6000/rs6000.cc
+++ b/gcc/config/rs6000/rs6000.cc
@@ -3662,14 +3662,17 @@ rs6000_option_override_internal (bool global_init_p)
 
   /* Without option powerpc64 specified explicitly, we need to ensure
      powerpc64 always enabled for 64 bit here, otherwise some following
-     checks can use unexpected TARGET_POWERPC64 value.  Meanwhile, we
-     need to ensure set_masks doesn't have OPTION_MASK_POWERPC64 on,
-     otherwise later processing can clear it.  */
+     checks can use unexpected TARGET_POWERPC64 value.  */
   if (!(rs6000_isa_flags_explicit & OPTION_MASK_POWERPC64)
       && TARGET_64BIT)
     {
       rs6000_isa_flags |= OPTION_MASK_POWERPC64;
-      set_masks &= ~OPTION_MASK_POWERPC64;
+      /* Need to stop powerpc64 from being unset in later processing,
+	 so clear it in set_masks.  But as PR108240 shows, to keep it
+	 consistent with before, we want to make this only if 64 bit
+	 is enabled explicitly.  This is a hack, revisit this later.  */
+      if (rs6000_isa_flags_explicit & OPTION_MASK_64BIT)
+	set_masks &= ~OPTION_MASK_POWERPC64;
     }
 
   /* Process the -mcpu=<xxx> and -mtune=<xxx> argument.  If the user changed

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2023-03-01  5:19 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-03-01  5:19 [gcc r13-6383] rs6000: Allow powerpc64 to be unset for implicit 64 bit [PR108240] Kewen Lin

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).