summaryrefslogtreecommitdiff
path: root/gcc/expr.h
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@gcc.gnu.org>2013-12-03 08:29:20 +0100
committerJakub Jelinek <jakub@gcc.gnu.org>2013-12-03 08:29:20 +0100
commit7f2f0a01cab6028542bdd57904a4147d17292d74 (patch)
tree4a5227f73abdd560a3d6b712c6c89fc4768357e7 /gcc/expr.h
parent4dd0ef2765ed87adce1dadc3187d6f7bd7ff29bb (diff)
re PR target/58864 (ICE in connect_traces, at dwarf2cfi.c:NNNN)
PR target/58864 * dojump.c (save_pending_stack_adjust, restore_pending_stack_adjust): New functions. * expr.h (struct saved_pending_stack_adjust): New type. (save_pending_stack_adjust, restore_pending_stack_adjust): New prototypes. * optabs.c (emit_conditional_move): Call save_pending_stack_adjust and get_last_insn before do_pending_stack_adjust, call restore_pending_stack_adjust after delete_insns_since. * expr.c (expand_expr_real_2): Don't call do_pending_stack_adjust before calling emit_conditional_move. * expmed.c (expand_sdiv_pow2): Likewise. * calls.c (expand_call): Use {save,restore}_pending_stack_adjust. * g++.dg/opt/pr58864.C: New test. From-SVN: r205618
Diffstat (limited to 'gcc/expr.h')
-rw-r--r--gcc/expr.h22
1 files changed, 22 insertions, 0 deletions
diff --git a/gcc/expr.h b/gcc/expr.h
index a2cd6690bfe..e734ef44016 100644
--- a/gcc/expr.h
+++ b/gcc/expr.h
@@ -473,6 +473,28 @@ extern void clear_pending_stack_adjust (void);
/* Pop any previously-pushed arguments that have not been popped yet. */
extern void do_pending_stack_adjust (void);
+/* Struct for saving/restoring of pending_stack_adjust/stack_pointer_delta
+ values. */
+
+struct saved_pending_stack_adjust
+{
+ /* Saved value of pending_stack_adjust. */
+ int x_pending_stack_adjust;
+
+ /* Saved value of stack_pointer_delta. */
+ int x_stack_pointer_delta;
+};
+
+/* Remember pending_stack_adjust/stack_pointer_delta.
+ To be used around code that may call do_pending_stack_adjust (),
+ but the generated code could be discarded e.g. using delete_insns_since. */
+
+extern void save_pending_stack_adjust (saved_pending_stack_adjust *);
+
+/* Restore the saved pending_stack_adjust/stack_pointer_delta. */
+
+extern void restore_pending_stack_adjust (saved_pending_stack_adjust *);
+
/* Return the tree node and offset if a given argument corresponds to
a string constant. */
extern tree string_constant (tree, tree *);