aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan Brittenson <bson@gnu.org>1993-09-22 11:33:20 -0700
committerJan Brittenson <bson@gnu.org>1993-09-22 11:33:20 -0700
commitc02bd5d96e33018e3eae39e69442437ad05bef39 (patch)
treebff57dfb449a14391c82e0c67ef12c41a3160585
parente9b7093a9f2c1125a3c0adc8f2a8d77f562631ff (diff)
downloadgcc-c02bd5d96e33018e3eae39e69442437ad05bef39.zip
gcc-c02bd5d96e33018e3eae39e69442437ad05bef39.tar.gz
gcc-c02bd5d96e33018e3eae39e69442437ad05bef39.tar.bz2
bytecode fixes
From-SVN: r5402
-rw-r--r--gcc/expr.c35
-rw-r--r--gcc/varasm.c12
2 files changed, 37 insertions, 10 deletions
diff --git a/gcc/expr.c b/gcc/expr.c
index 33f1bae..457d259 100644
--- a/gcc/expr.c
+++ b/gcc/expr.c
@@ -120,6 +120,16 @@ struct move_by_pieces
int reverse;
};
+/* Used to generate bytecodes: keep track of size of local variables,
+ as well as depth of arithmetic stack. (Notice that variables are
+ stored on the machine's stack, not the arithmetic stack.) */
+
+int local_vars_size;
+extern int stack_depth;
+extern int max_stack_depth;
+struct obstack permanent_obstack;
+
+
static rtx enqueue_insn PROTO((rtx, rtx));
static int queued_subexp_p PROTO((rtx));
static void init_queue PROTO((void));
@@ -5754,11 +5764,17 @@ bc_expand_expr (exp)
case REAL_CST:
+#if 0
#ifdef DEBUG_PRINT_CODE
fprintf (stderr, " [%g]\n", (double) TREE_INT_CST_LOW (exp));
#endif
+ /* FIX THIS: find a better way to pass real_cst's. -bson */
bc_emit_instruction (mode_to_const_map[TYPE_MODE (TREE_TYPE (exp))],
(double) TREE_REAL_CST (exp));
+#else
+ abort ();
+#endif
+
return;
case CALL_EXPR:
@@ -5875,7 +5891,7 @@ bc_expand_expr (exp)
case MODIFY_EXPR:
- expand_assignment (TREE_TYPE (exp), TREE_OPERAND (exp, 0), TREE_OPERAND (exp, 1));
+ expand_assignment (TREE_OPERAND (exp, 0), TREE_OPERAND (exp, 1), 0, 0);
return;
case ADDR_EXPR:
@@ -5914,7 +5930,7 @@ bc_expand_expr (exp)
bc_expand_expr (TREE_OPERAND (exp, 0));
bc_expand_truth_conversion (TREE_TYPE (TREE_OPERAND (exp, 0)));
lab = bc_get_bytecode_label ();
- bc_emit_bytecode (jumpifnot);
+ bc_emit_bytecode (xjumpifnot);
bc_emit_bytecode_labelref (lab);
#ifdef DEBUG_PRINT_CODE
@@ -5936,12 +5952,12 @@ bc_expand_expr (exp)
case TRUTH_ANDIF_EXPR:
- opcode = jumpifnot;
+ opcode = xjumpifnot;
goto andorif;
case TRUTH_ORIF_EXPR:
- opcode = jumpif;
+ opcode = xjumpif;
goto andorif;
case PLUS_EXPR:
@@ -6186,10 +6202,10 @@ bc_expand_expr (exp)
bc_expand_conversion (TREE_TYPE (TREE_OPERAND (exp, 1)), type);
/* Push the address of the lvalue */
- expand_expr (build1 (ADDR_EXPR, TYPE_POINTER_TO (type), TREE_OPERAND (exp, 0)));
+ bc_expand_expr (build1 (ADDR_EXPR, TYPE_POINTER_TO (type), TREE_OPERAND (exp, 0)));
/* Perform actual increment */
- expand_increment (incroptab, type);
+ bc_expand_increment (incroptab, type);
return;
}
@@ -7634,7 +7650,10 @@ expand_increment (exp, post)
int single_insn = 0;
if (output_bytecode)
- return bc_expand_increment (exp, post);
+ {
+ bc_expand_expr (exp);
+ return NULL_RTX;
+ }
/* Stabilize any component ref that might need to be
evaluated more than once below. */
@@ -9198,7 +9217,7 @@ bc_expand_component_address (exp)
break;
}
- expand_expr (tem);
+ bc_expand_expr (tem);
/* For bitfields also push their offset and size */
diff --git a/gcc/varasm.c b/gcc/varasm.c
index 641c6b7..e70dd84 100644
--- a/gcc/varasm.c
+++ b/gcc/varasm.c
@@ -2516,9 +2516,13 @@ output_constant_def_contents (exp, reloc, labelno)
if (align > BITS_PER_UNIT)
{
if (!output_bytecode)
- ASM_OUTPUT_ALIGN (asm_out_file, floor_log2 (align / BITS_PER_UNIT));
+ {
+ ASM_OUTPUT_ALIGN (asm_out_file, floor_log2 (align / BITS_PER_UNIT));
+ }
else
- BC_OUTPUT_ALIGN (asm_out_file, floor_log2 (align / BITS_PER_UNIT));
+ {
+ BC_OUTPUT_ALIGN (asm_out_file, floor_log2 (align / BITS_PER_UNIT));
+ }
}
/* Output the label itself. */
@@ -3613,6 +3617,8 @@ output_constructor (exp, size)
}
+#ifdef HANDLE_SYSV_PRAGMA
+
/* Output asm to handle ``#pragma weak'' */
void
handle_pragma_weak (what, asm_out_file, name, value)
@@ -3650,3 +3656,5 @@ handle_pragma_weak (what, asm_out_file, name, value)
else if (! (what == ps_done || what == ps_start))
warning ("malformed `#pragma weak'");
}
+
+#endif /* HANDLE_SYSV_PRAGMA */