Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/external/gpl3/gcc/dist/gcc/config/rs6000 Fix regression intr...



details:   https://anonhg.NetBSD.org/src/rev/07cce7b4661d
branches:  trunk
changeset: 961710:07cce7b4661d
user:      rin <rin%NetBSD.org@localhost>
date:      Fri Apr 16 02:26:43 2021 +0000

description:
Fix regression introduced to GCC10, where it wrongly recognizes 32-bit
processors as POWER9 if -misel flag is specified.

rs6000_machine_from_flags() assumes ISEL instructions are supported only
for POWER9 and successors. However, ISEL is also implemented for 32-bit
booke processors.

Since our kernel for booke is compiled with -misel, this regression
completely breaks it.

As a fix, check whether CPU is 64-bit capable or not, before checking
-misel flag.

The problem has been reported as 100108 to upstream:

        https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100108

OK mrg

diffstat:

 external/gpl3/gcc/dist/gcc/config/rs6000/rs6000.c |  6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diffs (23 lines):

diff -r ea0f4c04abe6 -r 07cce7b4661d external/gpl3/gcc/dist/gcc/config/rs6000/rs6000.c
--- a/external/gpl3/gcc/dist/gcc/config/rs6000/rs6000.c Fri Apr 16 02:26:25 2021 +0000
+++ b/external/gpl3/gcc/dist/gcc/config/rs6000/rs6000.c Fri Apr 16 02:26:43 2021 +0000
@@ -5552,6 +5552,8 @@
   /* Disable the flags that should never influence the .machine selection.  */
   flags &= ~(OPTION_MASK_PPC_GFXOPT | OPTION_MASK_PPC_GPOPT);
 
+  if ((flags & OPTION_MASK_POWERPC64) == 0)
+    return "ppc";
   if ((flags & (ISA_3_1_MASKS_SERVER & ~ISA_3_0_MASKS_SERVER)) != 0)
     return "power10";
   if ((flags & (ISA_3_0_MASKS_SERVER & ~ISA_2_7_MASKS_SERVER)) != 0)
@@ -5566,9 +5568,7 @@
     return "power5";
   if ((flags & ISA_2_1_MASKS) != 0)
     return "power4";
-  if ((flags & OPTION_MASK_POWERPC64) != 0)
-    return "ppc64";
-  return "ppc";
+  return "ppc64";
 }
 
 void



Home | Main Index | Thread Index | Old Index