0006-rs6000-Do-not-use-rs6000_cpu-for-.machine-ppc-and-pp.patch 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. From 6de33ed642f119f1e2543095dd56e4a94f97c27f Mon Sep 17 00:00:00 2001
  2. From: Segher Boessenkool <segher@kernel.crashing.org>
  3. Date: Fri, 11 Mar 2022 21:15:18 +0000
  4. Subject: [PATCH] rs6000: Do not use rs6000_cpu for .machine ppc and ppc64
  5. (PR104829)
  6. Fixes: 77eccbf39ed5
  7. rs6000.h has
  8. #define PROCESSOR_POWERPC PROCESSOR_PPC604
  9. #define PROCESSOR_POWERPC64 PROCESSOR_RS64A
  10. which means that if you use things like -mcpu=powerpc -mvsx it will no
  11. longer work after my latest .machine patch. This causes GCC build errors
  12. in some cases, not a good idea (even if the errors are actually
  13. pre-existing: using -mvsx with a machine that does not have VSX cannot
  14. work properly).
  15. 2022-03-11 Segher Boessenkool <segher@kernel.crashing.org>
  16. PR target/104829
  17. * config/rs6000/rs6000.c (rs6000_machine_from_flags): Don't output
  18. "ppc" and "ppc64" based on rs6000_cpu.
  19. (cherry picked from commit 80fcc4b6afee72443bef551064826b3b4b6785e6)
  20. (cherry picked from commit d87e0e297b1cba73a0c055d2a3e9267d288f435a)
  21. Signed-off-by: Romain Naour <romain.naour@gmail.com>
  22. ---
  23. gcc/config/rs6000/rs6000.c | 12 ++++++++++--
  24. 1 file changed, 10 insertions(+), 2 deletions(-)
  25. diff --git a/gcc/config/rs6000/rs6000.c b/gcc/config/rs6000/rs6000.c
  26. index 0a55c979c36..7e5cdd34840 100644
  27. --- a/gcc/config/rs6000/rs6000.c
  28. +++ b/gcc/config/rs6000/rs6000.c
  29. @@ -5782,20 +5782,28 @@ rs6000_machine_from_flags (void)
  30. if (rs6000_cpu == PROCESSOR_MPCCORE)
  31. return "\"821\"";
  32. +#if 0
  33. + /* This (and ppc64 below) are disabled here (for now at least) because
  34. + PROCESSOR_POWERPC, PROCESSOR_POWERPC64, and PROCESSOR_COMMON
  35. + are #define'd as some of these. Untangling that is a job for later. */
  36. +
  37. /* 600 series and 700 series, "classic" */
  38. if (rs6000_cpu == PROCESSOR_PPC601 || rs6000_cpu == PROCESSOR_PPC603
  39. || rs6000_cpu == PROCESSOR_PPC604 || rs6000_cpu == PROCESSOR_PPC604e
  40. - || rs6000_cpu == PROCESSOR_PPC750 || rs6000_cpu == PROCESSOR_POWERPC)
  41. + || rs6000_cpu == PROCESSOR_PPC750)
  42. return "ppc";
  43. +#endif
  44. /* Classic with AltiVec, "G4" */
  45. if (rs6000_cpu == PROCESSOR_PPC7400 || rs6000_cpu == PROCESSOR_PPC7450)
  46. return "\"7450\"";
  47. +#if 0
  48. /* The older 64-bit CPUs */
  49. if (rs6000_cpu == PROCESSOR_PPC620 || rs6000_cpu == PROCESSOR_PPC630
  50. - || rs6000_cpu == PROCESSOR_RS64A || rs6000_cpu == PROCESSOR_POWERPC64)
  51. + || rs6000_cpu == PROCESSOR_RS64A)
  52. return "ppc64";
  53. +#endif
  54. HOST_WIDE_INT flags = rs6000_isa_flags;
  55. --
  56. 2.34.3