diff options
author | Pierre-Marie de Rodat <derodat@adacore.com> | 2016-05-10 15:57:37 +0000 |
---|---|---|
committer | Pierre-Marie de Rodat <pmderodat@gcc.gnu.org> | 2016-05-10 15:57:37 +0000 |
commit | cd36c83e9bb1c8cf66082da63234925482695ef1 (patch) | |
tree | 70b03e461d6650956ff172656edd2eeb9bc01fb3 /gcc/dwarf2out.c | |
parent | afc610dba10fd532e83da10e19c5e0c5d7bcc34d (diff) | |
download | gcc-cd36c83e9bb1c8cf66082da63234925482695ef1.zip gcc-cd36c83e9bb1c8cf66082da63234925482695ef1.tar.gz gcc-cd36c83e9bb1c8cf66082da63234925482695ef1.tar.bz2 |
DWARF: fix stack usage assessment for DW_OP_neg
When the DWARF back-end generates DW_OP_neg operations in DWARF
procedures, we get an ICE because of inconsistent stack usage
computation for the embedding expression. This is because
resolve_args_picking_1 thinks DW_OP_neg is a binary operation (pops 2
stack slots, pushes 1) whereas it really is an unary one (one pop, one
push).
This change fixes resolve_args_picking_1 and adds a regression testcase
(which crashes with the current trunk). Bootstrapped and regtested
without regression on x86_64-linux.
gcc/
* dwarf2out.c (resolve_args_picking_1): Consider DW_OP_neg as an
unary operation, not a binary one.
gcc/testsuite/
* gnat.dg/debug6.adb, gnat.dg/debug6_pkg.ads: New testcase.
From-SVN: r236087
Diffstat (limited to 'gcc/dwarf2out.c')
-rw-r--r-- | gcc/dwarf2out.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c index da95e19..8f192e8 100644 --- a/gcc/dwarf2out.c +++ b/gcc/dwarf2out.c @@ -15407,6 +15407,7 @@ resolve_args_picking_1 (dw_loc_descr_ref loc, unsigned initial_frame_offset, case DW_OP_swap: case DW_OP_rot: case DW_OP_abs: + case DW_OP_neg: case DW_OP_not: case DW_OP_plus_uconst: case DW_OP_skip: @@ -15543,7 +15544,6 @@ resolve_args_picking_1 (dw_loc_descr_ref loc, unsigned initial_frame_offset, case DW_OP_minus: case DW_OP_mod: case DW_OP_mul: - case DW_OP_neg: case DW_OP_or: case DW_OP_plus: case DW_OP_shl: |