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

commit r16-7516-gd37f4b2a1acda7c9ee93ad370ece5292ee051b7a
Author: Rainer Orth <[email protected]>
Date:   Sat Feb 14 16:21:23 2026 +0100

    Remove HAVE_AS_SPARC_GOTDATA_OP
    
    Since the introduction of gcc_cv_as_flags on SPARC,
    HAVE_AS_SPARC_GOTDATA_OP became undefined on sparcv9-sun-solaris2.11
    with the native assembler.  This happens because /bin/as is now invoked
    with -m64, but the test fails to assemble:
    
    /bin/as: "gotdata_op.s", line 8: error: detect global register use not 
covered .register pseudo-op
    
    While the test can be adjusted by the addition of
    
            .register %g2, #scratch
    
    which makes it work with both as -m32/-m64 and gas --32/--64, it
    turns out the whole workaround has become unnecessary:
    
    When trying all combinations of as/ld with -m32/-m64, with both the
    original Solaris 11.4 as/ld and the current one, as well as gas/gld
    2.20.1, 2.30, and 2.46, the only cases where the test fails are when
    using gld 2.20.1.  Solaris/SPARC requires binutils 2.30 now, and 2.20.1
    can be considered ancient history on Linux/sparc64, too.  Therefore the
    test and the code guarded by it can just go.
    
    Bootstrapped without regressions on sparc{,v9}-sun-solaris2.11 and
    sparc64-unknown-linux-gnu.
    
    2026-02-12  Rainer Orth  <[email protected]>
    
            gcc:
            * configure.ac <sparc*-*-*> (gcc_cv_as_sparc_gotdata_op): Remove.
            * configure: Regenerate.
            * config.in: Regenerate.
            * config/sparc/sparc.md [!HAVE_AS_SPARC_GOTDATA_OP]: Remove.

Diff:
---
 gcc/config.in             |  6 ------
 gcc/config/sparc/sparc.md | 24 -----------------------
 gcc/configure             | 50 -----------------------------------------------
 gcc/configure.ac          | 26 ------------------------
 4 files changed, 106 deletions(-)

diff --git a/gcc/config.in b/gcc/config.in
index 2feb1d12b1b9..1ff03986a158 100644
--- a/gcc/config.in
+++ b/gcc/config.in
@@ -804,12 +804,6 @@
 #endif
 
 
-/* Define if your assembler and linker support GOTDATA_OP relocs. */
-#ifndef USED_FOR_TARGET
-#undef HAVE_AS_SPARC_GOTDATA_OP
-#endif
-
-
 /* Define if your assembler supports call36 relocation. */
 #ifndef USED_FOR_TARGET
 #undef HAVE_AS_SUPPORT_CALL36
diff --git a/gcc/config/sparc/sparc.md b/gcc/config/sparc/sparc.md
index 46f6e70405be..608f96100a05 100644
--- a/gcc/config/sparc/sparc.md
+++ b/gcc/config/sparc/sparc.md
@@ -1713,11 +1713,7 @@
                              UNSPEC_MOVE_PIC)))]
   "flag_pic"
 {
-#ifdef HAVE_AS_SPARC_GOTDATA_OP
   return "xor\t%1, %%gdop_lox10(%a2), %0";
-#else
-  return "or\t%1, %%lo(%a2), %0";
-#endif
 })
 
 (define_insn "movsi_high_pic"
@@ -1725,11 +1721,7 @@
         (high:SI (unspec:SI [(match_operand 1 "" "")] UNSPEC_MOVE_PIC)))]
   "flag_pic && check_pic (1)"
 {
-#ifdef HAVE_AS_SPARC_GOTDATA_OP
   return "sethi\t%%gdop_hix22(%a1), %0";
-#else
-  return "sethi\t%%hi(%a1), %0";
-#endif
 })
 
 (define_insn "movsi_pic_gotdata_op"
@@ -1740,11 +1732,7 @@
                   UNSPEC_MOVE_GOTDATA))]
   "flag_pic && check_pic (1)"
 {
-#ifdef HAVE_AS_SPARC_GOTDATA_OP
   return "ld\t[%1 + %2], %0, %%gdop(%a3)";
-#else
-  return "ld\t[%1 + %2], %0";
-#endif
 }
   [(set_attr "type" "load")
    (set_attr "subtype" "regular")])
@@ -1934,11 +1922,7 @@
                              UNSPEC_MOVE_PIC)))]
   "TARGET_ARCH64 && flag_pic"
 {
-#ifdef HAVE_AS_SPARC_GOTDATA_OP
   return "xor\t%1, %%gdop_lox10(%a2), %0";
-#else
-  return "or\t%1, %%lo(%a2), %0";
-#endif
 })
 
 (define_insn "movdi_high_pic"
@@ -1946,11 +1930,7 @@
         (high:DI (unspec:DI [(match_operand 1 "" "")] UNSPEC_MOVE_PIC)))]
   "TARGET_ARCH64 && flag_pic && check_pic (1)"
 {
-#ifdef HAVE_AS_SPARC_GOTDATA_OP
   return "sethi\t%%gdop_hix22(%a1), %0";
-#else
-  return "sethi\t%%hi(%a1), %0";
-#endif
 })
 
 (define_insn "movdi_pic_gotdata_op"
@@ -1961,11 +1941,7 @@
                   UNSPEC_MOVE_GOTDATA))]
   "TARGET_ARCH64 && flag_pic && check_pic (1)"
 {
-#ifdef HAVE_AS_SPARC_GOTDATA_OP
   return "ldx\t[%1 + %2], %0, %%gdop(%a3)";
-#else
-  return "ldx\t[%1 + %2], %0";
-#endif
 }
   [(set_attr "type" "load")
    (set_attr "subtype" "regular")])
diff --git a/gcc/configure b/gcc/configure
index 100e6e100120..f716bffaf839 100755
--- a/gcc/configure
+++ b/gcc/configure
@@ -29226,56 +29226,6 @@ if test $gcc_cv_as_sparc_relax = yes; then
 
 $as_echo "#define HAVE_AS_RELAX_OPTION 1" >>confdefs.h
 
-fi
-
-
-    { $as_echo "$as_me:${as_lineno-$LINENO}: checking assembler for GOTDATA_OP 
relocs" >&5
-$as_echo_n "checking assembler for GOTDATA_OP relocs... " >&6; }
-if ${gcc_cv_as_sparc_gotdata_op+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  gcc_cv_as_sparc_gotdata_op=no
-  if test x"$gcc_cv_as" != x; then
-    $as_echo '.text
-.align 4
-foo:
-       nop
-bar:
-       sethi %gdop_hix22(foo), %g1
-       xor    %g1, %gdop_lox10(foo), %g1
-       ld    [%l7 + %g1], %g2, %gdop(foo)' > conftest.s
-    if { ac_try='$gcc_cv_as $gcc_cv_as_flags -K PIC -o conftest.o conftest.s 
>&5'
-  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
-  test $ac_status = 0; }; }
-    then
-       if test x$gcc_cv_ld != x \
-       && $gcc_cv_ld -o conftest conftest.o -G > /dev/null 2>&1; then
-         if test x$gcc_cv_objdump != x; then
-           if $gcc_cv_objdump -s -j .text conftest 2> /dev/null \
-              | grep ' 03000004 82186004 c405c001'> /dev/null 2>&1; then
-              gcc_cv_as_sparc_gotdata_op=no
-           else
-              gcc_cv_as_sparc_gotdata_op=yes
-           fi
-         fi
-       fi
-       rm -f conftest
-    else
-      echo "configure: failed program was" >&5
-      cat conftest.s >&5
-    fi
-    rm -f conftest.o conftest.s
-  fi
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gcc_cv_as_sparc_gotdata_op" 
>&5
-$as_echo "$gcc_cv_as_sparc_gotdata_op" >&6; }
-if test $gcc_cv_as_sparc_gotdata_op = yes; then
-
-$as_echo "#define HAVE_AS_SPARC_GOTDATA_OP 1" >>confdefs.h
-
 fi
 
 
diff --git a/gcc/configure.ac b/gcc/configure.ac
index 35af1382cf1a..2ebecf7c91f0 100644
--- a/gcc/configure.ac
+++ b/gcc/configure.ac
@@ -4730,32 +4730,6 @@ EOF
       [AC_DEFINE(HAVE_AS_RELAX_OPTION, 1,
                [Define if your assembler supports -relax option.])])
 
-    gcc_GAS_CHECK_FEATURE([GOTDATA_OP relocs],
-      gcc_cv_as_sparc_gotdata_op,
-      [-K PIC],
-[.text
-.align 4
-foo:
-       nop
-bar:
-       sethi %gdop_hix22(foo), %g1
-       xor    %g1, %gdop_lox10(foo), %g1
-       ld    [[%l7 + %g1]], %g2, %gdop(foo)],
-      [if test x$gcc_cv_ld != x \
-       && $gcc_cv_ld -o conftest conftest.o -G > /dev/null 2>&1; then
-         if test x$gcc_cv_objdump != x; then
-           if $gcc_cv_objdump -s -j .text conftest 2> /dev/null \
-              | grep ' 03000004 82186004 c405c001'> /dev/null 2>&1; then
-              gcc_cv_as_sparc_gotdata_op=no
-           else
-              gcc_cv_as_sparc_gotdata_op=yes
-           fi
-         fi
-       fi
-       rm -f conftest],
-      [AC_DEFINE(HAVE_AS_SPARC_GOTDATA_OP, 1,
-               [Define if your assembler and linker support GOTDATA_OP 
relocs.])])
-
     gcc_GAS_CHECK_FEATURE([offsetable %lo()],
       gcc_cv_as_sparc_offsetable_lo10,
       [-xarch=v9],

Reply via email to