From: Pierre-Marie de Rodat Date: Tue, 3 May 2016 16:21:14 +0000 (+0000) Subject: Fix a typo in dwarf2out.c:resolve_args_picking_1 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=402e89f5986220a96898381cc32f7efe76bd092c;p=gcc.git Fix a typo in dwarf2out.c:resolve_args_picking_1 Under specific circumstances for Ada programs, such as in the testcase this change adds, the DWARF back-end currently crashes because of inconsistent internal state. This is due to a typo: a local variable is called frame_offset_ but resolve_args_picking_1 wrongly modifies emit-rtl.h's frame_offset instead. This change fixes this typo. gcc/ * dwarf2out.c (resolve_args_picking_1): Replace the frame_offset occurence with frame_offset_ ones. gcc/testsuite/ * gnat.dg/debug5.adb: New testcase. From-SVN: r235830 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 7cd0bd4f73d..1a85213eca6 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2016-05-03 Pierre-Marie de Rodat + + * dwarf2out.c (resolve_args_picking_1): Replace the frame_offset + occurence with frame_offset_ ones. + 2016-05-03 Alan Modra PR rtl-optimization/70890 diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c index 463863dc381..ab851f4628b 100644 --- a/gcc/dwarf2out.c +++ b/gcc/dwarf2out.c @@ -15571,7 +15571,7 @@ resolve_args_picking_1 (dw_loc_descr_ref loc, unsigned initial_frame_offset, if (stack_usage == NULL) return false; - frame_offset += *stack_usage; + frame_offset_ += *stack_usage; break; } diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 3ff4ea4d8f8..818a1775c59 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,7 @@ +2016-05-03 Pierre-Marie de Rodat + + * gnat.dg/debug5.adb: New testcase. + 2016-05-03 Dominik Vogt * gcc.target/s390/md/rXsbg_mode_sXl.c: New test. diff --git a/gcc/testsuite/gnat.dg/debug5.adb b/gcc/testsuite/gnat.dg/debug5.adb new file mode 100644 index 00000000000..6569a158029 --- /dev/null +++ b/gcc/testsuite/gnat.dg/debug5.adb @@ -0,0 +1,22 @@ +-- { dg-do compile } +-- { dg-options "-g" } + +procedure Debug5 is + + type Record_Type (L1, L2 : Natural) is record + S1 : String (1 .. L1); + case L2 is + when 0 => null; + when others => S2 : String (L1 .. L2); + end case; + end record; + + procedure Discard (R : Record_Type) is + begin + null; + end Discard; + + R : constant Record_Type := (0, 0, others => <>); +begin + Discard (R); +end Debug5;