diff --git a/gcc/ChangeLog b/gcc/ChangeLog index e43a062ce9d..941748c10eb 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2016-05-10 Pierre-Marie de Rodat + + * dwarf2out.c (resolve_args_picking_1): Consider DW_OP_neg as an + unary operation, not a binary one. + 2016-05-10 Ilya Enkovich PR tree-optimization/70786 diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c index da95e19849d..8f192e877d7 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: diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 7cf507f51f6..1e42f38989c 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,7 @@ +2016-05-10 Pierre-Marie de Rodat + + * gnat.dg/debug6.adb, gnat.dg/debug6_pkg.ads: New testcase. + 2016-05-10 Ilya Enkovich PR tree-optimization/70786 diff --git a/gcc/testsuite/gnat.dg/debug6.adb b/gcc/testsuite/gnat.dg/debug6.adb new file mode 100644 index 00000000000..25fdef206df --- /dev/null +++ b/gcc/testsuite/gnat.dg/debug6.adb @@ -0,0 +1,10 @@ +-- { dg-do compile } +-- { dg-options "-g" } + +with Debug6_Pkg; use Debug6_Pkg; + +procedure Debug6 is + V : Value := (Kind => Undefined); +begin + Process (V); +end Debug6; diff --git a/gcc/testsuite/gnat.dg/debug6_pkg.ads b/gcc/testsuite/gnat.dg/debug6_pkg.ads new file mode 100644 index 00000000000..dfc9744079b --- /dev/null +++ b/gcc/testsuite/gnat.dg/debug6_pkg.ads @@ -0,0 +1,16 @@ +package Debug6_Pkg is + + type Vkind is (Int, Undefined); + for Vkind use (Int => -2 ** 31, Undefined => 0); + + type Value (Kind : Vkind) is record + case Kind is + when Undefined => null; + when Int => Value : Integer; + when others => null; + end case; + end record; + + procedure Process (V : Value); + +end Debug6_Pkg;