public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc r14-8828] aarch64: Fix build against libc++ in c++11 mode [PR113763]
@ 2024-02-06 14:59 Jakub Jelinek
  0 siblings, 0 replies; only message in thread
From: Jakub Jelinek @ 2024-02-06 14:59 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:df9f6b934886f51c0c07220d1ee38874b69646c7

commit r14-8828-gdf9f6b934886f51c0c07220d1ee38874b69646c7
Author: Jakub Jelinek <jakub@redhat.com>
Date:   Tue Feb 6 15:56:50 2024 +0100

    aarch64: Fix build against libc++ in c++11 mode [PR113763]
    
    std::pair ctor used in tiles constexpr variable is only constexpr in C++14
    and later, it works with libstdc++ because it is marked constexpr there even
    in C++11 mode.
    
    The following patch fixes it by using an unnamed local class instead of
    std::pair, and additionally changes the first element from unsigned int to
    unsigned char because 0xff has to fit into unsigned char on all hosts.
    
    2024-02-06  Jakub Jelinek  <jakub@redhat.com>
    
            PR target/113763
            * config/aarch64/aarch64.cc (aarch64_output_sme_zero_za): Change tiles
            element from std::pair<unsigned int, char> to an unnamed struct.
            Adjust uses of tile range variable.

Diff:
---
 gcc/config/aarch64/aarch64.cc | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/gcc/config/aarch64/aarch64.cc b/gcc/config/aarch64/aarch64.cc
index 872393a82312..bdbfe2afb69a 100644
--- a/gcc/config/aarch64/aarch64.cc
+++ b/gcc/config/aarch64/aarch64.cc
@@ -13132,7 +13132,7 @@ aarch64_output_sme_zero_za (rtx mask)
   if (mask_val == 0xff)
     return "zero\t{ za }";
 
-  static constexpr std::pair<unsigned int, char> tiles[] = {
+  static constexpr struct { unsigned char mask; char letter; } tiles[] = {
     { 0xff, 'b' },
     { 0x55, 'h' },
     { 0x11, 's' },
@@ -13146,14 +13146,14 @@ aarch64_output_sme_zero_za (rtx mask)
   const char *prefix = "{ ";
   for (auto &tile : tiles)
     {
-      auto tile_mask = tile.first;
+      unsigned int tile_mask = tile.mask;
       unsigned int tile_index = 0;
       while (tile_mask < 0x100)
 	{
 	  if ((mask_val & tile_mask) == tile_mask)
 	    {
 	      i += snprintf (buffer + i, sizeof (buffer) - i, "%sza%d.%c",
-			     prefix, tile_index, tile.second);
+			     prefix, tile_index, tile.letter);
 	      prefix = ", ";
 	      mask_val &= ~tile_mask;
 	    }

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

only message in thread, other threads:[~2024-02-06 14:59 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-02-06 14:59 [gcc r14-8828] aarch64: Fix build against libc++ in c++11 mode [PR113763] Jakub Jelinek

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