diff options
author | Ian Lance Taylor <ian@gcc.gnu.org> | 1994-11-16 21:10:09 +0000 |
---|---|---|
committer | Ian Lance Taylor <ian@gcc.gnu.org> | 1994-11-16 21:10:09 +0000 |
commit | f76b9db2874507ed287d1fe39ca2b1e89ae95207 (patch) | |
tree | 036743ae971e4dddc0469a67fd6d6272b0801af8 /gcc/expr.h | |
parent | 1942e820686abbdd62515895e219476c26429945 (diff) | |
download | gcc-f76b9db2874507ed287d1fe39ca2b1e89ae95207.zip gcc-f76b9db2874507ed287d1fe39ca2b1e89ae95207.tar.gz gcc-f76b9db2874507ed287d1fe39ca2b1e89ae95207.tar.bz2 |
Check target endianness at run time, not compile time
From-SVN: r8470
Diffstat (limited to 'gcc/expr.h')
-rw-r--r-- | gcc/expr.h | 24 |
1 files changed, 8 insertions, 16 deletions
@@ -176,16 +176,14 @@ struct args_size enum direction {none, upward, downward}; /* Value has this type. */ #ifndef FUNCTION_ARG_PADDING -#if BYTES_BIG_ENDIAN #define FUNCTION_ARG_PADDING(MODE, TYPE) \ - (((MODE) == BLKmode \ - ? ((TYPE) && TREE_CODE (TYPE_SIZE (TYPE)) == INTEGER_CST \ - && int_size_in_bytes (TYPE) < (PARM_BOUNDARY / BITS_PER_UNIT)) \ - : GET_MODE_BITSIZE (MODE) < PARM_BOUNDARY) \ - ? downward : upward) -#else -#define FUNCTION_ARG_PADDING(MODE, TYPE) upward -#endif + (! BYTES_BIG_ENDIAN \ + ? upward \ + : (((MODE) == BLKmode \ + ? ((TYPE) && TREE_CODE (TYPE_SIZE (TYPE)) == INTEGER_CST \ + && int_size_in_bytes (TYPE) < (PARM_BOUNDARY / BITS_PER_UNIT)) \ + : GET_MODE_BITSIZE (MODE) < PARM_BOUNDARY) \ + ? downward : upward)) #endif /* Supply a default definition for FUNCTION_ARG_BOUNDARY. Normally, we let @@ -212,12 +210,6 @@ enum direction {none, upward, downward}; /* Value has this type. */ So a value padded in memory at the upper end can't go in a register. For a little-endian machine, the reverse is true. */ -#if BYTES_BIG_ENDIAN -#define MUST_PASS_IN_STACK_BAD_PADDING upward -#else -#define MUST_PASS_IN_STACK_BAD_PADDING downward -#endif - #define MUST_PASS_IN_STACK(MODE,TYPE) \ ((TYPE) != 0 \ && (TREE_CODE (TYPE_SIZE (TYPE)) != INTEGER_CST \ @@ -227,7 +219,7 @@ enum direction {none, upward, downward}; /* Value has this type. */ && 0 == (int_size_in_bytes (TYPE) \ % (PARM_BOUNDARY / BITS_PER_UNIT))) \ && (FUNCTION_ARG_PADDING (MODE, TYPE) \ - == MUST_PASS_IN_STACK_BAD_PADDING)))) + == (BYTES_BIG_ENDIAN ? upward : downward))))) /* Nonzero if type TYPE should be returned in memory. Most machines can use the following default definition. */ |