aboutsummaryrefslogtreecommitdiff
path: root/gcc/expr.h
diff options
context:
space:
mode:
authorIan Lance Taylor <ian@gcc.gnu.org>1994-11-16 21:10:09 +0000
committerIan Lance Taylor <ian@gcc.gnu.org>1994-11-16 21:10:09 +0000
commitf76b9db2874507ed287d1fe39ca2b1e89ae95207 (patch)
tree036743ae971e4dddc0469a67fd6d6272b0801af8 /gcc/expr.h
parent1942e820686abbdd62515895e219476c26429945 (diff)
downloadgcc-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.h24
1 files changed, 8 insertions, 16 deletions
diff --git a/gcc/expr.h b/gcc/expr.h
index c71b3f6..757ee63 100644
--- a/gcc/expr.h
+++ b/gcc/expr.h
@@ -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. */