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/bytecode.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/bytecode.h')
-rw-r--r-- | gcc/bytecode.h | 23 |
1 files changed, 6 insertions, 17 deletions
diff --git a/gcc/bytecode.h b/gcc/bytecode.h index 87030be..e2dc73a 100644 --- a/gcc/bytecode.h +++ b/gcc/bytecode.h @@ -24,28 +24,17 @@ extern int max_stack_depth; /* Emit DI constant according to target machine word ordering */ -#if WORDS_BIG_ENDIAN - #define bc_emit_bytecode_DI_const(CST) \ { int opcode; \ - opcode = TREE_INT_CST_HIGH (CST); \ + opcode = (WORDS_BIG_ENDIAN \ + ? TREE_INT_CST_HIGH (CST) \ + : TREE_INT_CST_LOW (CST)); \ bc_emit_bytecode_const ((char *) &opcode, sizeof opcode); \ - opcode = TREE_INT_CST_LOW (CST); \ + opcode = (WORDS_BIG_ENDIAN \ + ? TREE_INT_CST_LOW (CST) \ + : TREE_INT_CST_HIGH (CST)); \ bc_emit_bytecode_const ((char *) &opcode, sizeof opcode); \ } - -#else - -#define bc_emit_bytecode_DI_const(CST) \ -{ int opcode; \ - opcode = TREE_INT_CST_LOW (CST); \ - bc_emit_bytecode_const ((char *) &opcode, sizeof opcode); \ - opcode = TREE_INT_CST_HIGH (CST); \ - bc_emit_bytecode_const ((char *) &opcode, sizeof opcode); \ -} - -#endif - extern void bc_expand_expr (); extern void bc_output_data_constructor (); |