Commit d1accaa3 by Jakub Jelinek Committed by David S. Miller

configure.in: Add check for GAS subsection -1 support.

	* configure.in: Add check for GAS subsection -1 support.
	* acconfig.h (HAVE_GAS_SUBSECTION_ORDERING): Add.
	* configure config.in: Rebuilt.
	* config/sparc/sparc.h (CASE_VECTOR_MODE): For V9 flag_pic, use
	SImode is subsection -1 works, else use DImode.
	(ASM_OUTPUT_ADDR_VEC_START, ASM_OUTPUT_ADDR_VEC_END): Define if
	subsection -1 works.
	* config/sparc/sparc.c (sparc_output_addr_vec,
	sparc_output_addr_diff_vec): Use them if defined.

From-SVN: r22383
parent 6cf624a0
Thu Sep 10 21:19:10 1998 Jakub Jelinek <jj@sunsite.ms.mff.cuni.cz>
* configure.in: Add check for GAS subsection -1 support.
* acconfig.h (HAVE_GAS_SUBSECTION_ORDERING): Add.
* configure config.in: Rebuilt.
* config/sparc/sparc.h (CASE_VECTOR_MODE): For V9 flag_pic, use
SImode is subsection -1 works, else use DImode.
(ASM_OUTPUT_ADDR_VEC_START, ASM_OUTPUT_ADDR_VEC_END): Define if
subsection -1 works.
* config/sparc/sparc.c (sparc_output_addr_vec,
sparc_output_addr_diff_vec): Use them if defined.
Thu Sep 10 10:46:01 1998 Mark Mitchell <mark@markmitchell.com> Thu Sep 10 10:46:01 1998 Mark Mitchell <mark@markmitchell.com>
* tree.h (DECL_ORIGIN): New macro. * tree.h (DECL_ORIGIN): New macro.
......
...@@ -20,6 +20,10 @@ ...@@ -20,6 +20,10 @@
/* Define if your assembler supports .balign and .p2align. */ /* Define if your assembler supports .balign and .p2align. */
#undef HAVE_GAS_BALIGN_AND_P2ALIGN #undef HAVE_GAS_BALIGN_AND_P2ALIGN
/* Define if your assembler supports .subsection and .subsection -1 starts
emitting at the beginning of your section */
#undef HAVE_GAS_SUBSECTION_ORDERING
/* Define if you have a working <inttypes.h> header file. */ /* Define if you have a working <inttypes.h> header file. */
#undef HAVE_INTTYPES_H #undef HAVE_INTTYPES_H
......
...@@ -21,6 +21,10 @@ ...@@ -21,6 +21,10 @@
/* Define if your assembler supports .balign and .p2align. */ /* Define if your assembler supports .balign and .p2align. */
#undef HAVE_GAS_BALIGN_AND_P2ALIGN #undef HAVE_GAS_BALIGN_AND_P2ALIGN
/* Define if your assembler supports .subsection and .subsection -1 starts
emitting at the beginning of your section */
#undef HAVE_GAS_SUBSECTION_ORDERING
/* Define if you have a working <inttypes.h> header file. */ /* Define if you have a working <inttypes.h> header file. */
#undef HAVE_INTTYPES_H #undef HAVE_INTTYPES_H
......
...@@ -7196,6 +7196,10 @@ sparc_output_addr_vec (vec) ...@@ -7196,6 +7196,10 @@ sparc_output_addr_vec (vec)
rtx lab = XEXP (vec, 0), body = XEXP (vec, 1); rtx lab = XEXP (vec, 0), body = XEXP (vec, 1);
int idx, vlen = XVECLEN (body, 0); int idx, vlen = XVECLEN (body, 0);
#ifdef ASM_OUTPUT_ADDR_VEC_START
ASM_OUTPUT_ADDR_VEC_START (asm_out_file);
#endif
#ifdef ASM_OUTPUT_CASE_LABEL #ifdef ASM_OUTPUT_CASE_LABEL
ASM_OUTPUT_CASE_LABEL (asm_out_file, "L", CODE_LABEL_NUMBER (lab), ASM_OUTPUT_CASE_LABEL (asm_out_file, "L", CODE_LABEL_NUMBER (lab),
NEXT_INSN (lab)); NEXT_INSN (lab));
...@@ -7208,6 +7212,10 @@ sparc_output_addr_vec (vec) ...@@ -7208,6 +7212,10 @@ sparc_output_addr_vec (vec)
ASM_OUTPUT_ADDR_VEC_ELT ASM_OUTPUT_ADDR_VEC_ELT
(asm_out_file, CODE_LABEL_NUMBER (XEXP (XVECEXP (body, 0, idx), 0))); (asm_out_file, CODE_LABEL_NUMBER (XEXP (XVECEXP (body, 0, idx), 0)));
} }
#ifdef ASM_OUTPUT_ADDR_VEC_END
ASM_OUTPUT_ADDR_VEC_END (asm_out_file);
#endif
} }
static void static void
...@@ -7218,6 +7226,10 @@ sparc_output_addr_diff_vec (vec) ...@@ -7218,6 +7226,10 @@ sparc_output_addr_diff_vec (vec)
rtx base = XEXP (XEXP (body, 0), 0); rtx base = XEXP (XEXP (body, 0), 0);
int idx, vlen = XVECLEN (body, 1); int idx, vlen = XVECLEN (body, 1);
#ifdef ASM_OUTPUT_ADDR_VEC_START
ASM_OUTPUT_ADDR_VEC_START (asm_out_file);
#endif
#ifdef ASM_OUTPUT_CASE_LABEL #ifdef ASM_OUTPUT_CASE_LABEL
ASM_OUTPUT_CASE_LABEL (asm_out_file, "L", CODE_LABEL_NUMBER (lab), ASM_OUTPUT_CASE_LABEL (asm_out_file, "L", CODE_LABEL_NUMBER (lab),
NEXT_INSN (lab)); NEXT_INSN (lab));
...@@ -7233,6 +7245,10 @@ sparc_output_addr_diff_vec (vec) ...@@ -7233,6 +7245,10 @@ sparc_output_addr_diff_vec (vec)
CODE_LABEL_NUMBER (XEXP (XVECEXP (body, 1, idx), 0)), CODE_LABEL_NUMBER (XEXP (XVECEXP (body, 1, idx), 0)),
CODE_LABEL_NUMBER (base)); CODE_LABEL_NUMBER (base));
} }
#ifdef ASM_OUTPUT_ADDR_VEC_END
ASM_OUTPUT_ADDR_VEC_END (asm_out_file);
#endif
} }
static void static void
......
...@@ -2473,8 +2473,15 @@ extern struct rtx_def *legitimize_pic_address (); ...@@ -2473,8 +2473,15 @@ extern struct rtx_def *legitimize_pic_address ();
for the index in the tablejump instruction. */ for the index in the tablejump instruction. */
/* If we ever implement any of the full models (such as CM_FULLANY), /* If we ever implement any of the full models (such as CM_FULLANY),
this has to be DImode in that case */ this has to be DImode in that case */
#ifdef HAVE_GAS_SUBSECTION_ORDERING
#define CASE_VECTOR_MODE \ #define CASE_VECTOR_MODE \
(! TARGET_PTR64 ? SImode : flag_pic ? SImode : TARGET_CM_MEDLOW ? SImode : DImode) (! TARGET_PTR64 ? SImode : flag_pic ? SImode : TARGET_CM_MEDLOW ? SImode : DImode)
#else
/* If assembler does not have working .subsection -1, we use DImode for pic, as otherwise
we have to sign extend which slows things down. */
#define CASE_VECTOR_MODE \
(! TARGET_PTR64 ? SImode : flag_pic ? DImode : TARGET_CM_MEDLOW ? SImode : DImode)
#endif
/* Define as C expression which evaluates to nonzero if the tablejump /* Define as C expression which evaluates to nonzero if the tablejump
instruction expects the table to contain offsets from the address of the instruction expects the table to contain offsets from the address of the
...@@ -2999,6 +3006,20 @@ do { \ ...@@ -2999,6 +3006,20 @@ do { \
fputc ('\n', FILE); \ fputc ('\n', FILE); \
} while (0) } while (0)
/* This is what to output before and after case-vector (both
relative and absolute). If .subsection -1 works, we put case-vectors
at the beginning of the current section. */
#ifdef HAVE_GAS_SUBSECTION_ORDERING
#define ASM_OUTPUT_ADDR_VEC_START(FILE) \
fprintf(FILE, "\t.subsection\t-1\n")
#define ASM_OUTPUT_ADDR_VEC_END(FILE) \
fprintf(FILE, "\t.previous\n")
#endif
/* This is how to output an assembler line /* This is how to output an assembler line
that says to advance the location counter that says to advance the location counter
to a multiple of 2**LOG bytes. */ to a multiple of 2**LOG bytes. */
......
...@@ -5534,6 +5534,44 @@ EOF ...@@ -5534,6 +5534,44 @@ EOF
fi fi
echo "$ac_t""$gcc_cv_as_alignment_features" 1>&6 echo "$ac_t""$gcc_cv_as_alignment_features" 1>&6
echo $ac_n "checking assembler subsection support""... $ac_c" 1>&6
echo "configure:5539: checking assembler subsection support" >&5
gcc_cv_as_subsections=
if test x$gcc_cv_as != x; then
# Check if we have .subsection
echo ".subsection 1" > conftest.s
if $gcc_cv_as -o conftest.o conftest.s > /dev/null 2>&1; then
gcc_cv_as_subsections=".subsection"
if test -x nm$host_exeext; then
gcc_cv_nm=./nm$host_exeext
elif test x$host = x$target; then
# Native build.
gcc_cv_nm=nm$host_exeext
fi
if test x$gcc_cv_nm != x; then
cat > conftest.s <<EOF
conftest_label1: .word 0
.subsection -1
conftest_label2: .word 0
.previous
EOF
if $gcc_cv_as -o conftest.o conftest.s > /dev/null 2>&1; then
$gcc_cv_nm conftest.o | grep conftest_label1 > conftest.nm1
$gcc_cv_nm conftest.o | grep conftest_label2 | sed -e 's/label2/label1/' > conftest.nm2
if ! cmp conftest.nm1 conftest.nm2 > /dev/null 2>&1; then
gcc_cv_as_subsections="working .subsection -1"
cat >> confdefs.h <<\EOF
#define HAVE_GAS_SUBSECTION_ORDERING 1
EOF
fi
fi
fi
fi
rm -f conftest.s conftest.o conftest.nm1 conftest.nm2
fi
echo "$ac_t""$gcc_cv_as_subsections" 1>&6
# Figure out what language subdirectories are present. # Figure out what language subdirectories are present.
subdirs= subdirs=
for lang in ${srcdir}/*/config-lang.in .. for lang in ${srcdir}/*/config-lang.in ..
...@@ -5731,7 +5769,7 @@ fi ...@@ -5731,7 +5769,7 @@ fi
# Warn if using init_priority. # Warn if using init_priority.
echo $ac_n "checking whether to enable init_priority by default""... $ac_c" 1>&6 echo $ac_n "checking whether to enable init_priority by default""... $ac_c" 1>&6
echo "configure:5735: checking whether to enable init_priority by default" >&5 echo "configure:5773: checking whether to enable init_priority by default" >&5
if test x$enable_init_priority != xyes; then if test x$enable_init_priority != xyes; then
enable_init_priority=no enable_init_priority=no
fi fi
......
...@@ -3669,6 +3669,40 @@ if test x$gcc_cv_as != x; then ...@@ -3669,6 +3669,40 @@ if test x$gcc_cv_as != x; then
fi fi
AC_MSG_RESULT($gcc_cv_as_alignment_features) AC_MSG_RESULT($gcc_cv_as_alignment_features)
AC_MSG_CHECKING(assembler subsection support)
gcc_cv_as_subsections=
if test x$gcc_cv_as != x; then
# Check if we have .subsection
echo ".subsection 1" > conftest.s
if $gcc_cv_as -o conftest.o conftest.s > /dev/null 2>&1; then
gcc_cv_as_subsections=".subsection"
if test -x nm$host_exeext; then
gcc_cv_nm=./nm$host_exeext
elif test x$host = x$target; then
# Native build.
gcc_cv_nm=nm$host_exeext
fi
if test x$gcc_cv_nm != x; then
cat > conftest.s <<EOF
conftest_label1: .word 0
.subsection -1
conftest_label2: .word 0
.previous
EOF
if $gcc_cv_as -o conftest.o conftest.s > /dev/null 2>&1; then
$gcc_cv_nm conftest.o | grep conftest_label1 > conftest.nm1
$gcc_cv_nm conftest.o | grep conftest_label2 | sed -e 's/label2/label1/' > conftest.nm2
if ! cmp conftest.nm1 conftest.nm2 > /dev/null 2>&1; then
gcc_cv_as_subsections="working .subsection -1"
AC_DEFINE(HAVE_GAS_SUBSECTION_ORDERING)
fi
fi
fi
fi
rm -f conftest.s conftest.o conftest.nm1 conftest.nm2
fi
AC_MSG_RESULT($gcc_cv_as_subsections)
# Figure out what language subdirectories are present. # Figure out what language subdirectories are present.
subdirs= subdirs=
for lang in ${srcdir}/*/config-lang.in .. for lang in ${srcdir}/*/config-lang.in ..
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment