diff options
author | Franz Sirl <Franz.Sirl-kernel@lauterbach.com> | 2000-10-17 22:17:34 +0000 |
---|---|---|
committer | Franz Sirl <sirl@gcc.gnu.org> | 2000-10-17 22:17:34 +0000 |
commit | 832ea3b309246e34a445eae0969220f053e8e8b9 (patch) | |
tree | 60202866c1e0e05a002604b6b673a6c27f06bcd3 | |
parent | 34137553f95c4c36d1f601101becf90afc68d21e (diff) | |
download | gcc-832ea3b309246e34a445eae0969220f053e8e8b9.zip gcc-832ea3b309246e34a445eae0969220f053e8e8b9.tar.gz gcc-832ea3b309246e34a445eae0969220f053e8e8b9.tar.bz2 |
function.c (locate_and_pad_parm): Don't align stack unconditionally.
2000-10-17 Franz Sirl <Franz.Sirl-kernel@lauterbach.com>
* function.c (locate_and_pad_parm): Don't align stack unconditionally.
Fixes execute/20001017-1.c on pwerpc-linux-gnu.
* expr.c (store_constructor): Apply MEM_ALIAS_SET to MEMs only.
* rs6000/rs6000.c (rs6000_hash_constant): use X0INT to access a
LABEL_REF.
* rs6000/rs6000.h (NO_DOLLAR_IN_LABEL, DOLLARS_IN_IDENTIFIERS,
ENCODE_SECTION_INFO, ASM_OUTPUT_SPECIAL_POOL_ENTRY_P): Move from
here...
* rs6000/aix.h: ...to here.
* rs6000/linux.h (ASM_APP_ON, ASM_APP_OFF): Define to Linux-style.
From-SVN: r36914
-rw-r--r-- | gcc/ChangeLog | 15 | ||||
-rw-r--r-- | gcc/config/rs6000/aix.h | 46 | ||||
-rw-r--r-- | gcc/config/rs6000/linux.h | 8 | ||||
-rw-r--r-- | gcc/config/rs6000/rs6000.c | 2 | ||||
-rw-r--r-- | gcc/config/rs6000/rs6000.h | 46 | ||||
-rw-r--r-- | gcc/expr.c | 3 | ||||
-rw-r--r-- | gcc/function.c | 7 |
7 files changed, 78 insertions, 49 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index ed52370..a56ad45 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,18 @@ +2000-10-17 Franz Sirl <Franz.Sirl-kernel@lauterbach.com> + + * function.c (locate_and_pad_parm): Don't align stack unconditionally. + Fixes execute/20001017-1.c on pwerpc-linux-gnu. + + * expr.c (store_constructor): Apply MEM_ALIAS_SET to MEMs only. + * rs6000/rs6000.c (rs6000_hash_constant): use X0INT to access a + LABEL_REF. + + * rs6000/rs6000.h (NO_DOLLAR_IN_LABEL, DOLLARS_IN_IDENTIFIERS, + ENCODE_SECTION_INFO, ASM_OUTPUT_SPECIAL_POOL_ENTRY_P): Move from + here... + * rs6000/aix.h: ...to here. + * rs6000/linux.h (ASM_APP_ON, ASM_APP_OFF): Define to Linux-style. + 2000-10-17 Jakub Jelinek <jakub@redhat.com> * config/alpha/alpha.h (ASM_OUTPUT_MI_THUNK): Reload gp if needed. diff --git a/gcc/config/rs6000/aix.h b/gcc/config/rs6000/aix.h index 741f6c7..080bfc3 100644 --- a/gcc/config/rs6000/aix.h +++ b/gcc/config/rs6000/aix.h @@ -50,6 +50,17 @@ Boston, MA 02111-1307, USA. */ #define FASCIST_ASSEMBLER +/* We define this to prevent the name mangler from putting dollar signs into + function names. */ + +#define NO_DOLLAR_IN_LABEL + +/* We define this to 0 so that gcc will never accept a dollar sign in a + variable name. This is needed because the AIX assembler will not accept + dollar signs. */ + +#define DOLLARS_IN_IDENTIFIERS 0 + /* AIX does not have any init/fini or ctor/dtor sections, so create static constructors and destructors as normal functions. */ /* #define ASM_OUTPUT_CONSTRUCTOR(file, name) */ @@ -227,6 +238,30 @@ toc_section () \ } \ } +/* Return non-zero if this entry is to be written into the constant + pool in a special way. We do so if this is a SYMBOL_REF, LABEL_REF + or a CONST containing one of them. If -mfp-in-toc (the default), + we also do this for floating-point constants. We actually can only + do this if the FP formats of the target and host machines are the + same, but we can't check that since not every file that uses + GO_IF_LEGITIMATE_ADDRESS_P includes real.h. We also do this when + we can write the entry into the TOC and the entry is not larger + than a TOC entry. */ + +#define ASM_OUTPUT_SPECIAL_POOL_ENTRY_P(X, MODE) \ + (TARGET_TOC \ + && (GET_CODE (X) == SYMBOL_REF \ + || (GET_CODE (X) == CONST && GET_CODE (XEXP (X, 0)) == PLUS \ + && GET_CODE (XEXP (XEXP (X, 0), 0)) == SYMBOL_REF) \ + || GET_CODE (X) == LABEL_REF \ + || (GET_CODE (X) == CONST_INT \ + && GET_MODE_BITSIZE (MODE) <= GET_MODE_BITSIZE (Pmode)) \ + || (GET_CODE (X) == CONST_DOUBLE \ + && (TARGET_POWERPC64 \ + || TARGET_MINIMAL_TOC \ + || (GET_MODE_CLASS (GET_MODE (X)) == MODE_FLOAT \ + && ! TARGET_NO_FP_IN_TOC))))) + /* Select section for constant in constant pool. On RS/6000, all constants are in the private read-only data area. @@ -240,6 +275,17 @@ toc_section () \ read_only_private_data_section (); \ } +/* If we are referencing a function that is static or is known to be + in this file, make the SYMBOL_REF special. We can use this to indicate + that we can branch to this function without emitting a no-op after the + call. Do not set this flag if the function is weakly defined. */ + +#define ENCODE_SECTION_INFO(DECL) \ + if (TREE_CODE (DECL) == FUNCTION_DECL \ + && (TREE_ASM_WRITTEN (DECL) || ! TREE_PUBLIC (DECL)) \ + && ! DECL_WEAK (DECL)) \ + SYMBOL_REF_FLAG (XEXP (DECL_RTL (DECL), 0)) = 1; + /* Indicate that jump tables go in the text section. */ #define JUMP_TABLES_IN_TEXT_SECTION 1 diff --git a/gcc/config/rs6000/linux.h b/gcc/config/rs6000/linux.h index a28a8bd..9fe8501 100644 --- a/gcc/config/rs6000/linux.h +++ b/gcc/config/rs6000/linux.h @@ -54,6 +54,14 @@ Boston, MA 02111-1307, USA. */ #undef TARGET_VERSION #define TARGET_VERSION fprintf (stderr, " (PowerPC GNU/Linux)"); +/* Override rs6000.h definition. */ +#undef ASM_APP_ON +#define ASM_APP_ON "#APP\n" + +/* Override rs6000.h definition. */ +#undef ASM_APP_OFF +#define ASM_APP_OFF "#NO_APP\n" + #undef DEFAULT_VTABLE_THUNKS #ifndef USE_GNULIBC_1 #define DEFAULT_VTABLE_THUNKS 1 diff --git a/gcc/config/rs6000/rs6000.c b/gcc/config/rs6000/rs6000.c index 9250bc1..789a2f7 100644 --- a/gcc/config/rs6000/rs6000.c +++ b/gcc/config/rs6000/rs6000.c @@ -6556,7 +6556,7 @@ rs6000_hash_constant (k) int fidx; if (GET_CODE (k) == LABEL_REF) - return result * 1231 + XINT (XEXP (k, 0), 3); + return result * 1231 + X0INT (XEXP (k, 0), 3); if (GET_CODE (k) == CONST_DOUBLE) fidx = 2; diff --git a/gcc/config/rs6000/rs6000.h b/gcc/config/rs6000/rs6000.h index 8ab59cb..3bb567b 100644 --- a/gcc/config/rs6000/rs6000.h +++ b/gcc/config/rs6000/rs6000.h @@ -2310,17 +2310,6 @@ extern int rs6000_compare_fp_p; the end of the line. */ #define ASM_COMMENT_START " #" -/* We define this to prevent the name mangler from putting dollar signs into - function names. */ - -#define NO_DOLLAR_IN_LABEL - -/* We define this to 0 so that gcc will never accept a dollar sign in a - variable name. This is needed because the AIX assembler will not accept - dollar signs. */ - -#define DOLLARS_IN_IDENTIFIERS 0 - /* Implicit library calls should use memcpy, not bcopy, etc. */ #define TARGET_MEM_FUNCTIONS @@ -2331,44 +2320,9 @@ extern int rs6000_compare_fp_p; #define EXCEPTION_SECTION data_section -/* If we are referencing a function that is static or is known to be - in this file, make the SYMBOL_REF special. We can use this to indicate - that we can branch to this function without emitting a no-op after the - call. Do not set this flag if the function is weakly defined. */ - -#define ENCODE_SECTION_INFO(DECL) \ - if (TREE_CODE (DECL) == FUNCTION_DECL \ - && (TREE_ASM_WRITTEN (DECL) || ! TREE_PUBLIC (DECL)) \ - && ! DECL_WEAK (DECL)) \ - SYMBOL_REF_FLAG (XEXP (DECL_RTL (DECL), 0)) = 1; - /* Flag to say the TOC is initialized */ extern int toc_initialized; -/* Return non-zero if this entry is to be written into the constant - pool in a special way. We do so if this is a SYMBOL_REF, LABEL_REF - or a CONST containing one of them. If -mfp-in-toc (the default), - we also do this for floating-point constants. We actually can only - do this if the FP formats of the target and host machines are the - same, but we can't check that since not every file that uses - GO_IF_LEGITIMATE_ADDRESS_P includes real.h. We also do this when - we can write the entry into the TOC and the entry is not larger - than a TOC entry. */ - -#define ASM_OUTPUT_SPECIAL_POOL_ENTRY_P(X, MODE) \ - (TARGET_TOC \ - && (GET_CODE (X) == SYMBOL_REF \ - || (GET_CODE (X) == CONST && GET_CODE (XEXP (X, 0)) == PLUS \ - && GET_CODE (XEXP (XEXP (X, 0), 0)) == SYMBOL_REF) \ - || GET_CODE (X) == LABEL_REF \ - || (GET_CODE (X) == CONST_INT \ - && GET_MODE_BITSIZE (MODE) <= GET_MODE_BITSIZE (Pmode)) \ - || (GET_CODE (X) == CONST_DOUBLE \ - && (TARGET_POWERPC64 \ - || TARGET_MINIMAL_TOC \ - || (GET_MODE_CLASS (GET_MODE (X)) == MODE_FLOAT \ - && ! TARGET_NO_FP_IN_TOC))))) - /* Macro to output a special constant pool entry. Go to WIN if we output it. Otherwise, it is written the usual way. @@ -4206,7 +4206,8 @@ store_constructor_field (target, bitsize, bitpos, plus_constant (XEXP (target, 0), bitpos / BITS_PER_UNIT)); - MEM_ALIAS_SET (target) = alias_set; + if (GET_CODE (target) == MEM) + MEM_ALIAS_SET (target) = alias_set; store_constructor (exp, target, align, cleared, bitsize / BITS_PER_UNIT); } else diff --git a/gcc/function.c b/gcc/function.c index 4cf7119..07528ec 100644 --- a/gcc/function.c +++ b/gcc/function.c @@ -5149,7 +5149,12 @@ locate_and_pad_parm (passed_mode, type, in_regs, fndecl, - offset_ptr->constant); #else /* !ARGS_GROW_DOWNWARD */ - pad_to_arg_alignment (initial_offset_ptr, boundary, alignment_pad); + if (!in_regs +#ifdef REG_PARM_STACK_SPACE + || REG_PARM_STACK_SPACE (fndecl) > 0 +#endif + ) + pad_to_arg_alignment (initial_offset_ptr, boundary, alignment_pad); *offset_ptr = *initial_offset_ptr; #ifdef PUSH_ROUNDING |