--- gcc/config/i386.h 2018/04/24 17:51:31 1.1 +++ gcc/config/i386.h 2018/04/24 17:53:46 1.1.1.2 @@ -19,7 +19,7 @@ the Free Software Foundation, 675 Mass A /* The purpose of this file is to define the characteristics of the i386, - independant of assembler syntax or operating system. + independent of assembler syntax or operating system. Three other files build on this one to describe a specific assembler syntax: bsd386.h, att386.h, and sun386.h. @@ -91,7 +91,7 @@ extern int target_flags; /* Not true for 80386 */ #define WORDS_BIG_ENDIAN 0 -/* number of bits in an addressible storage unit */ +/* number of bits in an addressable storage unit */ #define BITS_PER_UNIT 8 /* Width in bits of a "word", which is the contents of a machine register. @@ -129,9 +129,9 @@ extern int target_flags; quantities, but these can be aligned on any 32-bit boundary. */ #define BIGGEST_ALIGNMENT 32 -/* Define this if move instructions will actually fail to work +/* Set this non-zero if move instructions will actually fail to work when given unaligned data. */ -/* #define STRICT_ALIGNMENT */ +#define STRICT_ALIGNMENT 0 /* If bit field type is int, don't let it cross an int, and give entire struct the alignment of an int. */ @@ -309,13 +309,16 @@ extern int target_flags; in a smaller-numbered class. For any two classes, it is very desirable that there be another - class that represents their union. */ - + class that represents their union. + + It might seem that class BREG is unnecessary, since no useful 386 + opcode needs reg %ebx. But some systems pass args to the OS in ebx, + and the "b" register constraint is useful in asms for syscalls. */ enum reg_class { NO_REGS, - AREG, DREG, CREG, + AREG, DREG, CREG, BREG, Q_REGS, /* %eax %ebx %ecx %edx */ SIREG, DIREG, INDEX_REGS, /* %eax %ebx %ecx %edx %esi %edi %ebp */ @@ -331,7 +334,7 @@ enum reg_class #define REG_CLASS_NAMES \ { "NO_REGS", \ - "AREG", "DREG", "CREG", \ + "AREG", "DREG", "CREG", "BREG", \ "Q_REGS", \ "SIREG", "DIREG", \ "INDEX_REGS", \ @@ -346,7 +349,7 @@ enum reg_class #define REG_CLASS_CONTENTS \ { 0, \ - 0x1, 0x2, 0x4, /* AREG, DREG, CREG */ \ + 0x1, 0x2, 0x4, 0x8, /* AREG, DREG, CREG, BREG */ \ 0xf, /* Q_REGS */ \ 0x10, 0x20, /* SIREG, DIREG */ \ 0x1007f, /* INDEX_REGS */ \ @@ -409,6 +412,7 @@ extern enum reg_class regclass_map[FIRST (C) == 't' ? FP_TOP_REG : \ (C) == 'u' ? FP_SECOND_REG : \ (C) == 'a' ? AREG : \ + (C) == 'b' ? BREG : \ (C) == 'c' ? CREG : \ (C) == 'd' ? DREG : \ (C) == 'D' ? DIREG : \ @@ -435,10 +439,12 @@ extern enum reg_class regclass_map[FIRST 0) /* Similar, but for floating constants, and defining letters G and H. - Here VALUE is the CONST_DOUBLE rtx itself. */ + Here VALUE is the CONST_DOUBLE rtx itself. We allow constants even if + TARGET_387 isn't set, because the stack register converter may need to + load 0.0 into the function value register. */ #define CONST_DOUBLE_OK_FOR_LETTER_P(VALUE, C) \ - ((C) == 'G' ? (TARGET_80387 && standard_80387_constant_p (VALUE)) : 0) + ((C) == 'G' ? standard_80387_constant_p (VALUE) : 0) /* Place additional restrictions on the register class to use when it is necessary to be able to hold a value of mode @var{mode} in a reload @@ -988,7 +994,7 @@ do { \ differently depending on something about the variable or function named by the symbol (such as what section it is in). - On i386, if using PIC, mark a SYMBOL_REF for a static declaration + On i386, if using PIC, mark a SYMBOL_REF for a non-global symbol so that we may access it directly in the GOT. */ #define ENCODE_SECTION_INFO(DECL) \ @@ -996,9 +1002,11 @@ do \ { \ if (flag_pic) \ { \ - rtx decl_rtl = (TREE_CODE_CLASS (TREE_CODE (DECL)) == 'c' \ - ? TREE_CST_RTL (DECL) : DECL_RTL (DECL)); \ - SYMBOL_REF_FLAG (XEXP (decl_rtl, 0)) = ! TREE_PUBLIC (DECL); \ + rtx rtl = (TREE_CODE_CLASS (TREE_CODE (DECL)) != 'd' \ + ? TREE_CST_RTL (DECL) : DECL_RTL (DECL)); \ + SYMBOL_REF_FLAG (XEXP (rtl, 0)) \ + = (TREE_CODE_CLASS (TREE_CODE (DECL)) != 'd' \ + || ! TREE_PUBLIC (DECL)); \ } \ } \ while (0) @@ -1201,7 +1209,7 @@ to get gcc to use these, since they want number as al, and ax. */ -/* note the last four are not really qi_registsers, but +/* note the last four are not really qi_registers, but the md will have to never output movb into one of them only a movw . There is no movb into the last four regs */