diff options
author | ian <ian@138bc75d-0d04-0410-961f-82ee72b054a4> | 1994-11-16 21:10:09 +0000 |
---|---|---|
committer | ian <ian@138bc75d-0d04-0410-961f-82ee72b054a4> | 1994-11-16 21:10:09 +0000 |
commit | 51356f864933f664f7dfbf6e25ddcd97b587441a (patch) | |
tree | 036743ae971e4dddc0469a67fd6d6272b0801af8 /gcc/bytecode.h | |
parent | d70e58b6facc61184689890af429c7f0def003e8 (diff) | |
download | gcc-51356f864933f664f7dfbf6e25ddcd97b587441a.tar.gz |
Check target endianness at run time, not compile time
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@8470 138bc75d-0d04-0410-961f-82ee72b054a4
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 87030bef698..e2dc73a5fff 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 (); |