--- gcc/config/i386/osfrose.h 2018/04/24 18:16:39 1.1.1.2 +++ gcc/config/i386/osfrose.h 2018/04/24 18:30:36 1.1.1.4 @@ -16,7 +16,8 @@ GNU General Public License for more deta You should have received a copy of the GNU General Public License along with GNU CC; see the file COPYING. If not, write to -the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ +the Free Software Foundation, 59 Temple Place - Suite 330, +Boston, MA 02111-1307, USA. */ #include "halfpic.h" #include "i386/gstabs.h" @@ -48,13 +49,13 @@ the Free Software Foundation, 675 Mass A || (CHAR) == 'h' \ || (CHAR) == 'z') -#define MASK_HALF_PIC 0x40000000 /* Mask for half-pic code */ -#define MASK_HALF_PIC_DEBUG 0x20000000 /* Debug flag */ -#define MASK_ELF 0x10000000 /* ELF not rose */ -#define MASK_NO_IDENT 0x08000000 /* suppress .ident */ -#define MASK_NO_UNDERSCORES 0x04000000 /* suppress leading _ */ -#define MASK_LARGE_ALIGN 0x02000000 /* align to >word boundaries */ -#define MASK_NO_MCOUNT 0x01000000 /* profiling uses mcount_ptr */ +#define MASK_HALF_PIC 010000000000 /* Mask for half-pic code */ +#define MASK_HALF_PIC_DEBUG 004000000000 /* Debug flag */ +#define MASK_ELF 002000000000 /* ELF not rose */ +#define MASK_NO_IDENT 001000000000 /* suppress .ident */ +#define MASK_NO_UNDERSCORES 000400000000 /* suppress leading _ */ +#define MASK_LARGE_ALIGN 000200000000 /* align to >word boundaries */ +#define MASK_NO_MCOUNT 000100000000 /* profiling uses mcount_ptr */ #define TARGET_HALF_PIC (target_flags & MASK_HALF_PIC) #define TARGET_DEBUG (target_flags & MASK_HALF_PIC_DEBUG) @@ -67,21 +68,22 @@ the Free Software Foundation, 675 Mass A #define TARGET_MCOUNT ((target_flags & MASK_NO_MCOUNT) == 0) #undef SUBTARGET_SWITCHES -#define SUBTARGET_SWITCHES \ - { "half-pic", MASK_HALF_PIC}, \ - { "no-half-pic", -MASK_HALF_PIC}, \ - { "debug-half-pic", MASK_HALF_PIC_DEBUG}, \ - { "debugb", MASK_HALF_PIC_DEBUG}, \ - { "elf", MASK_ELF}, \ - { "rose", -MASK_ELF}, \ - { "ident", -MASK_NO_IDENT}, \ - { "no-ident", MASK_NO_IDENT}, \ - { "underscores", -MASK_NO_UNDERSCORES}, \ - { "no-underscores", MASK_NO_UNDERSCORES}, \ - { "large-align", MASK_LARGE_ALIGN}, \ - { "no-large-align",-MASK_LARGE_ALIGN}, \ - { "mcount", -MASK_NO_MCOUNT}, \ - { "no-mcount", MASK_NO_MCOUNT}, +#define SUBTARGET_SWITCHES \ + { "half-pic", MASK_HALF_PIC}, \ + { "no-half-pic", -MASK_HALF_PIC}, \ + { "debug-half-pic", MASK_HALF_PIC_DEBUG}, \ + { "debugb", MASK_HALF_PIC_DEBUG}, \ + { "elf", MASK_ELF}, \ + { "rose", -MASK_ELF}, \ + { "ident", -MASK_NO_IDENT}, \ + { "no-ident", MASK_NO_IDENT}, \ + { "underscores", -MASK_NO_UNDERSCORES}, \ + { "no-underscores", MASK_NO_UNDERSCORES}, \ + { "large-align", MASK_LARGE_ALIGN}, \ + { "no-large-align", -MASK_LARGE_ALIGN}, \ + { "mcount", -MASK_NO_MCOUNT}, \ + { "mcount-ptr", MASK_NO_MCOUNT}, \ + { "no-mcount", MASK_NO_MCOUNT}, /* OSF/rose uses stabs, not dwarf. */ #define PREFERRED_DEBUGGING_TYPE DBX_DEBUG @@ -93,6 +95,7 @@ the Free Software Foundation, 675 Mass A /* Handle #pragma weak and #pragma pack. */ #define HANDLE_SYSV_PRAGMA +#define SUPPORTS_WEAK TARGET_ELF /* Change default predefines. */ #undef CPP_PREDEFINES @@ -112,15 +115,18 @@ the Free Software Foundation, 675 Mass A %{.m: -D__LANGUAGE_OBJECTIVE_C} \ %{!.S: -D__LANGUAGE_C %{!ansi:-DLANGUAGE_C}}" -/* Turn on -pic-extern by default. */ +/* Turn on -pic-extern by default for OSF/rose, -fpic for ELF. */ #undef CC1_SPEC #define CC1_SPEC "\ -%{!melf: %{!mrose: -mrose }} \ -%{melf: %{!munderscores: %{!mno-underscores: -mno-underscores }}} \ %{gline:%{!g:%{!g0:%{!g1:%{!g2: -g1}}}}} \ -%{!melf: %{pic-none: -mno-half-pic} \ - %{pic-extern: } %{pic-lib: } %{pic-calls: } %{pic-names*: } \ - %{!pic-none: -mhalf-pic }}" +%{!melf: %{!mrose: -mrose }} \ +%{melf: %{!munderscores: %{!mno-underscores: -mno-underscores }} \ + %{!mmcount: %{!mno-mcount: %{!mmcount-ptr: -mmcount-ptr }}}} \ +%{!melf: %{!munderscores: %{!mno-underscores: -munderscores }} \ + %{!mmcount: %{!mno-mcount: %{!mmcount-ptr: -mmcount }}} \ + %{pic-extern: -mhalf-pic } %{pic-lib: -mhalf-pic } \ + %{!pic-extern: %{!pic-lib: %{pic-none: -mno-half-pic} %{!pic-none: -mhalf-pic}}} \ + %{pic-calls: } %{pic-names*: }}" #undef ASM_SPEC #define ASM_SPEC "%{v*: -v}" @@ -173,8 +179,15 @@ the Free Software Foundation, 675 Mass A #define WCHAR_TYPE "unsigned int" #define WCHAR_TYPE_SIZE BITS_PER_WORD -/* Temporarily turn off long double being 96 bits. */ +/* Define this macro if the system header files support C++ as well + as C. This macro inhibits the usual method of using system header + files in C++, which is to pretend that the file's contents are + enclosed in `extern "C" {...}'. */ +#define NO_IMPLICIT_EXTERN_C + +/* Turn off long double being 96 bits. */ #undef LONG_DOUBLE_TYPE_SIZE +#define LONG_DOUBLE_TYPE_SIZE 64 /* This macro generates the assembly code for function entry. FILE is a stdio stream to output the code to. @@ -234,7 +247,7 @@ do \ fprintf (FILE, "%sPc%d:\tpopl %%eax\n", lprefix, call_no); \ fprintf (FILE, "\taddl $_GLOBAL_OFFSET_TABLE_+[.-%sPc%d],%%eax\n", \ lprefix, call_no++); \ - fprintf (FILE, "\tleal $%sP%d@GOTOFF(%%eax),%%edx\n", \ + fprintf (FILE, "\tleal %sP%d@GOTOFF(%%eax),%%edx\n", \ lprefix, labelno); \ fprintf (FILE, "\tmovl %s_mcount_ptr@GOT(%%eax),%%eax\n", \ prefix); \ @@ -252,7 +265,7 @@ while (0) expects to find the address. The name of this variable is `LP' followed by the number LABELNO, so you would generate the name using `LP%d' in a `fprintf'. - + The details of how the address should be passed to `mcount' are determined by your operating system environment, not by GNU CC. To figure them out, compile a small program for profiling using the system's installed C @@ -305,9 +318,9 @@ do \ { \ fprintf (FILE, "\tmovl 4(%%ebp),%%ecx\n"); \ fprintf (FILE, "\tpushl %%ecx\n"); \ - fprintf (FILE, "\tleal $%sP%d@GOTOFF(%%ebx),%%edx\n", \ + fprintf (FILE, "\tleal %sP%d@GOTOFF(%%ebx),%%edx\n", \ lprefix, labelno); \ - fprintf (FILE, "\tmovl _mcount_ptr@GOT(%%eax),%%eax\n"); \ + fprintf (FILE, "\tmovl _mcount_ptr@GOT(%%ebx),%%eax\n"); \ fprintf (FILE, "\tcall *(%%eax)\n"); \ fprintf (FILE, "\tpopl %%eax\n"); \ } \ @@ -327,83 +340,6 @@ do \ } \ while (0) -/* A C statement or compound statement to output to FILE some - assembler code to initialize basic-block profiling for the current - object module. This code should call the subroutine - `__bb_init_func' once per object module, passing it as its sole - argument the address of a block allocated in the object module. - - The name of the block is a local symbol made with this statement: - - ASM_GENERATE_INTERNAL_LABEL (BUFFER, "LPBX", 0); - - Of course, since you are writing the definition of - `ASM_GENERATE_INTERNAL_LABEL' as well as that of this macro, you - can take a short cut in the definition of this macro and use the - name that you know will result. - - The first word of this block is a flag which will be nonzero if the - object module has already been initialized. So test this word - first, and do not call `__bb_init_func' if the flag is nonzero. */ - -#undef FUNCTION_BLOCK_PROFILER -#define FUNCTION_BLOCK_PROFILER(STREAM, LABELNO) \ -do \ - { \ - if (!flag_pic) \ - { \ - fprintf (STREAM, "\tcmpl $0,%sPBX0\n", LPREFIX); \ - fprintf (STREAM, "\tjne 0f\n"); \ - fprintf (STREAM, "\tpushl $%sPBX0\n", LPREFIX); \ - fprintf (STREAM, "\tcall %s__bb_init_func\n", \ - (TARGET_UNDERSCORES) ? "_" : ""); \ - fprintf (STREAM, "0:\n"); \ - } \ - else \ - { \ - fprintf (STREAM, "\tpushl %eax\n"); \ - fprintf (STREAM, "\tmovl %sPBX0@GOT(%ebx),%eax\n"); \ - fprintf (STREAM, "\tcmpl $0,(%eax)\n"); \ - fprintf (STREAM, "\tjne 0f\n"); \ - fprintf (STREAM, "\tpushl %eax\n"); \ - fprintf (STREAM, "\tcall %s__bb_init_func@PLT\n", \ - (TARGET_UNDERSCORES) ? "_" : ""); \ - fprintf (STREAM, "0:\n"); \ - fprintf (STREAM, "\tpopl %eax\n"); \ - } \ - } \ -while (0) - -/* A C statement or compound statement to increment the count - associated with the basic block number BLOCKNO. Basic blocks are - numbered separately from zero within each compilation. The count - associated with block number BLOCKNO is at index BLOCKNO in a - vector of words; the name of this array is a local symbol made - with this statement: - - ASM_GENERATE_INTERNAL_LABEL (BUFFER, "LPBX", 2); - - Of course, since you are writing the definition of - `ASM_GENERATE_INTERNAL_LABEL' as well as that of this macro, you - can take a short cut in the definition of this macro and use the - name that you know will result. */ - -#undef BLOCK_PROFILER -#define BLOCK_PROFILER(STREAM, BLOCKNO) \ -do \ - { \ - if (!flag_pic) \ - fprintf (STREAM, "\tincl %sPBX2+%d\n", LPREFIX, (BLOCKNO)*4); \ - else \ - { \ - fprintf (STREAM, "\tpushl %eax\n"); \ - fprintf (STREAM, "\tmovl %sPBX2@GOT(%ebx),%eax\n", LPREFIX); \ - fprintf (STREAM, "\tincl %d(%eax)\n", (BLOCKNO)*4); \ - fprintf (STREAM, "\tpopl %eax\n"); \ - } \ - } \ -while (0) - /* A C function or functions which are needed in the library to support block profiling. When support goes into libc, undo the #if 0. */ @@ -451,6 +387,18 @@ while (0) #define ASM_OUTPUT_ADDR_DIFF_ELT(FILE, VALUE, REL) \ fprintf (FILE, "\t.long _GLOBAL_OFFSET_TABLE_+[.-%s%d]\n", LPREFIX, VALUE) +/* Output a definition */ +#define ASM_OUTPUT_DEF(FILE,LABEL1,LABEL2) \ +do \ +{ \ + fprintf ((FILE), "\t%s\t", SET_ASM_OP); \ + assemble_name (FILE, LABEL1); \ + fprintf (FILE, ","); \ + assemble_name (FILE, LABEL2); \ + fprintf (FILE, "\n"); \ + } \ +while (0) + /* A C expression to output text to align the location counter in the way that is desirable at a point in the code that is reached only by jumping. @@ -462,7 +410,7 @@ while (0) #undef ASM_OUTPUT_ALIGN_CODE #define ASM_OUTPUT_ALIGN_CODE(STREAM) \ fprintf (STREAM, "\t.align\t%d\n", \ - (TARGET_486 && TARGET_LARGE_ALIGN) ? 4 : 2) + (!TARGET_LARGE_ALIGN && i386_align_jumps > 2) ? 2 : i386_align_jumps) /* A C expression to output text to align the location counter in the way that is desirable at the beginning of a loop. @@ -473,7 +421,7 @@ while (0) #undef ASM_OUTPUT_LOOP_ALIGN #define ASM_OUTPUT_LOOP_ALIGN(STREAM) \ - fprintf (STREAM, "\t.align\t2\n") + fprintf (STREAM, "\t.align\t%d\n", i386_align_loops) /* A C statement to output to the stdio stream STREAM an assembler command to advance the location counter to a multiple of 2 to the @@ -513,60 +461,6 @@ while (0) || GET_CODE (X) == CONST_INT \ || !HALF_PIC_ADDRESS_P (X)) -/* GO_IF_LEGITIMATE_ADDRESS recognizes an RTL expression - that is a valid memory address for an instruction. - The MODE argument is the machine mode for the MEM expression - that wants to use this address. */ - -#define GO_IF_LEGITIMATE_ADDRESS_ORIG(MODE, X, ADDR) \ -{ \ - if (CONSTANT_ADDRESS_P (X) \ - && (! flag_pic || LEGITIMATE_PIC_OPERAND_P (X))) \ - goto ADDR; \ - GO_IF_INDEXING (X, ADDR); \ - if (GET_CODE (X) == PLUS && CONSTANT_ADDRESS_P (XEXP (X, 1))) \ - { \ - rtx x0 = XEXP (X, 0); \ - if (! flag_pic || ! SYMBOLIC_CONST (XEXP (X, 1))) \ - { GO_IF_INDEXING (x0, ADDR); } \ - else if (x0 == pic_offset_table_rtx) \ - goto ADDR; \ - else if (GET_CODE (x0) == PLUS) \ - { \ - if (XEXP (x0, 0) == pic_offset_table_rtx) \ - { GO_IF_INDEXABLE_BASE (XEXP (x0, 1), ADDR); } \ - if (XEXP (x0, 1) == pic_offset_table_rtx) \ - { GO_IF_INDEXABLE_BASE (XEXP (x0, 0), ADDR); } \ - } \ - } \ -} - -#undef GO_IF_LEGITIMATE_ADDRESS -#define GO_IF_LEGITIMATE_ADDRESS(MODE, X, ADDR) \ -{ \ - if (! HALF_PIC_P ()) \ - { \ - GO_IF_LEGITIMATE_ADDRESS_ORIG(MODE, X, ADDR); \ - } \ - else \ - { \ - if (CONSTANT_P (X) && ! HALF_PIC_ADDRESS_P (X)) \ - goto ADDR; \ - \ - GO_IF_INDEXING (X, ADDR); \ - if (GET_CODE (X) == PLUS) \ - { \ - rtx x1 = XEXP (X, 1); \ - \ - if (CONSTANT_P (x1) && ! HALF_PIC_ADDRESS_P (x1)) \ - { \ - rtx x0 = XEXP (X, 0); \ - GO_IF_INDEXING (x0, ADDR); \ - } \ - } \ - } \ -} - /* Sometimes certain combinations of command options do not make sense on a particular target machine. You can define a macro `OVERRIDE_OPTIONS' to take account of this. This macro, if @@ -599,7 +493,7 @@ while (0) function named by the symbol (such as what section it is in). The macro definition, if any, is executed immediately after the - rtl for DECL has been created and stored in `DECL_RTL (DECL)'. + rtl for DECL has been created and stored in `DECL_RTL (DECL)'. The value of the rtl will be a `mem' whose address is a `symbol_ref'. @@ -609,7 +503,7 @@ while (0) information). The best way to modify the name string is by adding text to the - beginning, with suitable punctuation to prevent any ambiguity. + beginning, with suitable punctuation to prevent any ambiguity. Allocate the new name in `saveable_obstack'. You will have to modify `ASM_OUTPUT_LABELREF' to remove and decode the added text and output the name accordingly. @@ -703,7 +597,10 @@ while (0) else if (TREE_CODE (DECL) != VAR_DECL) \ readonly_data_section (); \ \ - else if (!TREE_READONLY (DECL)) \ + else if (!TREE_READONLY (DECL) || TREE_SIDE_EFFECTS (DECL) \ + || !DECL_INITIAL (DECL) \ + || (DECL_INITIAL (DECL) != error_mark_node \ + && !TREE_CONSTANT (DECL_INITIAL (DECL)))) \ data_section (); \ \ else \ @@ -719,9 +616,14 @@ while (0) #define TYPE_ASM_OP ".type" #define SIZE_ASM_OP ".size" -#define WEAK_ASM_OP ".weak" #define SET_ASM_OP ".set" +/* This is how we tell the assembler that a symbol is weak. */ + +#define ASM_WEAKEN_LABEL(FILE,NAME) \ + do { fputs ("\t.weak\t", FILE); assemble_name (FILE, NAME); \ + fputc ('\n', FILE); } while (0) + /* The following macro defines the format used to output the second operand of the .type assembler directive. Different svr4 assemblers expect various different forms for this operand. The one given here @@ -733,7 +635,7 @@ while (0) /* A C statement (sans semicolon) to output to the stdio stream STREAM any text necessary for declaring the name NAME of an initialized variable which is being defined. This macro must - output the label definition (perhaps using `ASM_OUTPUT_LABEL'). + output the label definition (perhaps using `ASM_OUTPUT_LABEL'). The argument DECL is the `VAR_DECL' tree node representing the variable. @@ -894,6 +796,12 @@ do \ if (flag_unroll_loops) \ fprintf ((STREAM), " -funroll-loops"); \ \ + if (flag_schedule_insns) \ + fprintf ((STREAM), " -fschedule-insns"); \ + \ + if (flag_schedule_insns_after_reload) \ + fprintf ((STREAM), " -fschedule-insns2"); \ + \ if (flag_force_mem) \ fprintf ((STREAM), " -fforce-mem"); \ \ @@ -927,7 +835,18 @@ do \ if (TARGET_HALF_PIC) \ fprintf ((STREAM), " -mhalf-pic"); \ \ - fprintf ((STREAM), (TARGET_486) ? " -m486" : " -m386"); \ + if (!TARGET_MOVE) \ + fprintf ((STREAM), " -mno-move"); \ + \ + if (TARGET_386) \ + fprintf ((STREAM), " -m386"); \ + \ + else if (TARGET_486) \ + fprintf ((STREAM), " -m486"); \ + \ + else \ + fprintf ((STREAM), " -munknown-machine"); \ + \ fprintf ((STREAM), (TARGET_ELF) ? " -melf\"\n" : " -mrose\"\n"); \ } \ } \ @@ -937,8 +856,7 @@ while (0) #define OBJECT_FORMAT_ROSE /* Tell collect where the appropriate binaries are. */ -#define REAL_LD_FILE_NAME "/usr/ccs/gcc/gld" -#define REAL_NM_FILE_NAME "/usr/ccs/bin/nm" +#define REAL_NM_FILE_NAME "/usr/ccs/gcc/bfd-nm" #define REAL_STRIP_FILE_NAME "/usr/ccs/bin/strip" /* Use atexit for static constructors/destructors, instead of defining @@ -965,62 +883,6 @@ while (0) output_lang_identify (STREAM); \ } -/* This is how to output an assembler line defining a `double' constant. - Use "word" pseudos to avoid printing NaNs, infinity, etc. */ - -/* This is how to output an assembler line defining a `double' constant. */ -#undef ASM_OUTPUT_DOUBLE -#define ASM_OUTPUT_DOUBLE(STREAM, VALUE) \ -do \ - { \ - long value_long[2]; \ - char dstr[30]; \ - REAL_VALUE_TO_TARGET_DOUBLE (VALUE, value_long); \ - REAL_VALUE_TO_DECIMAL (VALUE, "%.20g", dstr); \ - if (sizeof (int) == sizeof (long)) \ - fprintf (STREAM, "\t.long\t0x%08x\t\t# %s\n\t.long\t0x%08x\n", \ - value_long[0], dstr, value_long[1]); \ - else \ - fprintf (STREAM, "\t.long\t0x%08lx\t\t# %s\n\t.long\t0x%08lx\n", \ - value_long[0], dstr, value_long[1]); \ - } \ -while (0) - -/* This is how to output an assembler line defining a `float' constant. */ -#undef ASM_OUTPUT_FLOAT -#define ASM_OUTPUT_FLOAT(STREAM, VALUE) \ -do \ - { \ - long value_long; \ - char dstr[30]; \ - REAL_VALUE_TO_TARGET_SINGLE (VALUE, value_long); \ - REAL_VALUE_TO_DECIMAL (VALUE, "%.12g", dstr); \ - if (sizeof (int) == sizeof (long)) \ - fprintf (STREAM, "\t.long\t0x%08x\t\t# %s (float)\n", \ - value_long, dstr); \ - else \ - fprintf (STREAM, "\t.long\t0x%08lx\t\t# %s (float)\n", \ - value_long, dstr); \ - } \ -while (0) - -/* This is how to output an assembler line for a `long double' constant. */ -#undef ASM_OUTPUT_LONG_DOUBLE -#define ASM_OUTPUT_LONG_DOUBLE(FILE,VALUE) \ -do { long l[3]; \ - char dstr[30]; \ - REAL_VALUE_TO_TARGET_LONG_DOUBLE (VALUE, l); \ - REAL_VALUE_TO_DECIMAL (VALUE, "%.20g", dstr); \ - if (sizeof (int) == sizeof (long)) \ - fprintf (FILE, \ - "\t.long\t0x%08x\t\t# %s\n\t.long\t0x%08x\n\t.long\t0x%08x\n", \ - l[0], dstr, l[1], l[2]); \ - else \ - fprintf (FILE, \ - "\t.long\t0x%08lx\t\t# %s\n\t.long\t0x%08lx\n\t.long\t0x%08lx\n", \ - l[0], dstr, l[1], l[2]); \ - } while (0) - /* Generate calls to memcpy, etc., not bcopy, etc. */ #define TARGET_MEM_FUNCTIONS