diff options
author | Jakub Jelinek <jj@sunsite.ms.mff.cuni.cz> | 1998-09-11 00:28:30 +0200 |
---|---|---|
committer | David S. Miller <davem@gcc.gnu.org> | 1998-09-10 15:28:30 -0700 |
commit | d1accaa33ddcbf491edbb6023d639f6d3579bc00 (patch) | |
tree | c8b5a568b15e1730be67b19c2270b0fd997a8876 | |
parent | 6cf624a0a5db1265c836e04134f3d8b4e7b86b3b (diff) | |
download | gcc-d1accaa33ddcbf491edbb6023d639f6d3579bc00.zip gcc-d1accaa33ddcbf491edbb6023d639f6d3579bc00.tar.gz gcc-d1accaa33ddcbf491edbb6023d639f6d3579bc00.tar.bz2 |
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
-rw-r--r-- | gcc/ChangeLog | 12 | ||||
-rw-r--r-- | gcc/acconfig.h | 4 | ||||
-rw-r--r-- | gcc/config.in | 4 | ||||
-rw-r--r-- | gcc/config/sparc/sparc.c | 16 | ||||
-rw-r--r-- | gcc/config/sparc/sparc.h | 21 | ||||
-rwxr-xr-x | gcc/configure | 40 | ||||
-rw-r--r-- | gcc/configure.in | 34 |
7 files changed, 130 insertions, 1 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index d49c232..753ebea 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,15 @@ +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> * tree.h (DECL_ORIGIN): New macro. diff --git a/gcc/acconfig.h b/gcc/acconfig.h index 4aac693..0e43b15 100644 --- a/gcc/acconfig.h +++ b/gcc/acconfig.h @@ -20,6 +20,10 @@ /* Define if your assembler supports .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. */ #undef HAVE_INTTYPES_H diff --git a/gcc/config.in b/gcc/config.in index 3cd381a..0c5b696 100644 --- a/gcc/config.in +++ b/gcc/config.in @@ -21,6 +21,10 @@ /* Define if your assembler supports .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. */ #undef HAVE_INTTYPES_H diff --git a/gcc/config/sparc/sparc.c b/gcc/config/sparc/sparc.c index ee1f8ef..6e7d27a 100644 --- a/gcc/config/sparc/sparc.c +++ b/gcc/config/sparc/sparc.c @@ -7196,6 +7196,10 @@ sparc_output_addr_vec (vec) rtx lab = XEXP (vec, 0), body = XEXP (vec, 1); 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 ASM_OUTPUT_CASE_LABEL (asm_out_file, "L", CODE_LABEL_NUMBER (lab), NEXT_INSN (lab)); @@ -7208,6 +7212,10 @@ sparc_output_addr_vec (vec) ASM_OUTPUT_ADDR_VEC_ELT (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 @@ -7218,6 +7226,10 @@ sparc_output_addr_diff_vec (vec) rtx base = XEXP (XEXP (body, 0), 0); 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 ASM_OUTPUT_CASE_LABEL (asm_out_file, "L", CODE_LABEL_NUMBER (lab), NEXT_INSN (lab)); @@ -7233,6 +7245,10 @@ sparc_output_addr_diff_vec (vec) CODE_LABEL_NUMBER (XEXP (XVECEXP (body, 1, idx), 0)), CODE_LABEL_NUMBER (base)); } + +#ifdef ASM_OUTPUT_ADDR_VEC_END + ASM_OUTPUT_ADDR_VEC_END (asm_out_file); +#endif } static void diff --git a/gcc/config/sparc/sparc.h b/gcc/config/sparc/sparc.h index cffa476..c68c3d0 100644 --- a/gcc/config/sparc/sparc.h +++ b/gcc/config/sparc/sparc.h @@ -2473,8 +2473,15 @@ extern struct rtx_def *legitimize_pic_address (); for the index in the tablejump instruction. */ /* If we ever implement any of the full models (such as CM_FULLANY), this has to be DImode in that case */ +#ifdef HAVE_GAS_SUBSECTION_ORDERING #define CASE_VECTOR_MODE \ (! 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 instruction expects the table to contain offsets from the address of the @@ -2999,6 +3006,20 @@ do { \ fputc ('\n', FILE); \ } 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 that says to advance the location counter to a multiple of 2**LOG bytes. */ diff --git a/gcc/configure b/gcc/configure index 8269e5e..608019a 100755 --- a/gcc/configure +++ b/gcc/configure @@ -5534,6 +5534,44 @@ EOF fi 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. subdirs= for lang in ${srcdir}/*/config-lang.in .. @@ -5731,7 +5769,7 @@ fi # Warn if using init_priority. 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 enable_init_priority=no fi diff --git a/gcc/configure.in b/gcc/configure.in index 911a119..98848d4 100644 --- a/gcc/configure.in +++ b/gcc/configure.in @@ -3669,6 +3669,40 @@ if test x$gcc_cv_as != x; then fi 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. subdirs= for lang in ${srcdir}/*/config-lang.in .. |