>From 7b974976c2245e8c230569fa356d031965a42c41 Mon Sep 17 00:00:00 2001
From: Zhongteng Gui <[email protected]>
Date: Thu, 22 Oct 2026 00:58:17 +0800
Subject: [PATCH 1/4] i386: Remove outdated message from GCC 4.6 (passing
 aligned parameter) [PR128083]

This removes "the ABI for passing parameters with %d-byte alignment has
changed in GCC 4.6".  It has been 15 years since then.

gcc/ChangeLog:

        * config/i386/i386.cc (ix86_compat_function_arg_boundary):
        Removed.  No longer used anywhere.
        (ix86_function_arg_boundary): Don't warn for ABI change from GCC
        4.6.

gcc/testsuite/ChangeLog:

        * gcc.target/i386/pr68657.c: Remove dg-message.

Signed-off-by: Zhongteng Gui <[email protected]>
---
 gcc/config/i386/i386.cc                 | 50 -------------------------
 gcc/testsuite/gcc.target/i386/pr68657.c |  1 -
 2 files changed, 51 deletions(-)

diff --git a/gcc/config/i386/i386.cc b/gcc/config/i386/i386.cc
index 0b29d9a4026..e68246a74d8 100644
--- a/gcc/config/i386/i386.cc
+++ b/gcc/config/i386/i386.cc
@@ -3754,41 +3754,6 @@ ix86_compat_aligned_value_p (const_tree type)
   return false;
 }
 
-/* Return the alignment boundary for MODE and TYPE with alignment ALIGN.
-   XXX: This function is obsolete and is only used for checking psABI
-   compatibility with previous versions of GCC.  */
-
-static unsigned int
-ix86_compat_function_arg_boundary (machine_mode mode,
-                                  const_tree type, unsigned int align)
-{
-  /* In 32bit, only _Decimal128 and __float128 are aligned to their
-     natural boundaries.  */
-  if (!TARGET_64BIT && mode != TDmode && mode != TFmode)
-    {
-      /* i386 ABI defines all arguments to be 4 byte aligned.  We have to
-        make an exception for SSE modes since these require 128bit
-        alignment.
-
-        The handling here differs from field_alignment.  ICC aligns MMX
-        arguments to 4 byte boundaries, while structure fields are aligned
-        to 8 byte boundaries.  */
-      if (!type)
-       {
-         if (!(TARGET_SSE && SSE_REG_MODE_P (mode)))
-           align = PARM_BOUNDARY;
-       }
-      else
-       {
-         if (!ix86_compat_aligned_value_p (type))
-           align = PARM_BOUNDARY;
-       }
-    }
-  if (align > BIGGEST_ALIGNMENT)
-    align = BIGGEST_ALIGNMENT;
-  return align;
-}
-
 /* Return true when TYPE should be 128bit aligned for 32bit argument
    passing ABI.  */
 
@@ -3864,9 +3829,6 @@ ix86_function_arg_boundary (machine_mode mode, const_tree 
type)
     align = PARM_BOUNDARY;
   else
     {
-      static bool warned;
-      unsigned int saved_align = align;
-
       if (!TARGET_64BIT)
        {
          /* i386 ABI defines XFmode arguments to be 4 byte aligned.  */
@@ -3881,18 +3843,6 @@ ix86_function_arg_boundary (machine_mode mode, 
const_tree type)
          if (align < 128)
            align = PARM_BOUNDARY;
        }
-
-      if (warn_psabi
-         && !warned
-         && align != ix86_compat_function_arg_boundary (mode, type,
-                                                        saved_align))
-       {
-         warned = true;
-         inform (input_location,
-                 "the ABI for passing parameters with %d-byte"
-                 " alignment has changed in GCC 4.6",
-                 align / BITS_PER_UNIT);
-       }
     }
 
   return align;
diff --git a/gcc/testsuite/gcc.target/i386/pr68657.c 
b/gcc/testsuite/gcc.target/i386/pr68657.c
index 3480242760f..0f8eae8841e 100644
--- a/gcc/testsuite/gcc.target/i386/pr68657.c
+++ b/gcc/testsuite/gcc.target/i386/pr68657.c
@@ -4,7 +4,6 @@
 typedef int V __attribute__((vector_size (64)));
 
 void foo (V x, V *y) { /* { dg-error "AVX512F vector argument without AVX512F 
enabled" } */
-  /* { dg-message "the ABI for passing parameters with 64-byte alignment has 
changed" "" { target *-*-* } .-1 } */
   *y = x;
 }
 
-- 
2.56.0.windows.2

Reply via email to