]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
LVU: revert loc insn flushes; emit it right away if with view
authorAlexandre Oliva <aoliva@redhat.com>
Wed, 19 Jul 2017 03:05:33 +0000 (00:05 -0300)
committerAlexandre Oliva <aoliva@redhat.com>
Wed, 19 Jul 2017 03:05:33 +0000 (00:05 -0300)
gas/config/tc-mips.c
gas/config/tc-sh.c
gas/doc/as.texinfo
gas/dwarf2dbg.c
gas/read.c
gas/subsegs.c
gas/testsuite/gas/elf/dwarf2-8.l
gas/testsuite/gas/elf/dwarf2-9.l

index 176d635e06f0ef8007cec407ca342a0b5018d6cb..4eeb5ee6b20f25be4d8a999d66ee51ca8996c918 100644 (file)
@@ -15865,7 +15865,6 @@ mips_align (int to, int *fill, struct insn_label_list *labels)
 {
   mips_emit_delays ();
   mips_record_compressed_mode ();
-  dwarf2_emit_insn (0);
   if (fill == NULL && subseg_text_p (now_seg))
     frag_align_code (to, 0);
   else
index 8baae268e42690c8b79d453a7f7f74072477eb29..cb5fb24bc9ec0a34d6ce6099d836927f58af71d9 100644 (file)
@@ -831,8 +831,6 @@ sh_elf_cons (int nbytes)
       return;
     }
 
-  dwarf2_emit_insn (0);
-
 #ifdef md_cons_align
   md_cons_align (nbytes);
 #endif
index a6ddc7cdbf3fbed51a77e0a9736f84024195513d..65b14a42ca7f1c2503967fe41624391a89547a0c 100644 (file)
@@ -5834,18 +5834,17 @@ This directive will set the @code{discriminator} register in the @code{.debug_li
 state machine to @var{value}, which must be an unsigned integer.
 
 @item view @var{value}
-This directive will verify that the @code{view} register in the
-@code{.debug_line} state machine matches @var{value}.  In general, the
-@code{view} register counts how many prior @code{.loc} directives are at the
-same program location, but there are a few exceptions, such as that view
-numbers may be forced reset e.g. at function entry points, or they may not be
-reset even when the location changes.  The assembler will determine the view
-number for that @code{.loc}.  Then, if @var{value} is a label, it will set the
-label to the @var{value}.  Otherwise, @var{value} may be either @code{0}, in
-which case the assembler will error out if the computed view number is not
-zero, or @code{-0}, that will cause the assembler to arrange for the
-@code{view} register to be reset for this @code{.loc} even if for @code{0} it
-would have issued an error.
+This option causes a row to be added to @code{.debug_line} in reference to the
+current address (which might not be the same as that of the following assembly
+instruction), and to associate @var{value} with the @code{view} register in the
+@code{.debug_line} state machine.  If @var{value} is a label, both the
+@code{view} register and the label are set to the number of prior @code{.loc}
+directives at the same program location.  If @var{value} is the literal
+@code{0}, the @code{view} register is set to zero, and the assembler asserts
+that there aren't any prior @code{.loc} directives at the same program
+location.  If @var{value} is the literal @code{-0}, the assembler arrange for
+the @code{view} register to be reset in this row, even if there are prior
+@code{.loc} directives at the same program location.
 
 @end table
 
index 04d7ef9e08f5c6219617d8b283a9eadeeaffc16d..c3d6043ff0f714701e2d115028163f937c5720ca 100644 (file)
@@ -957,6 +957,10 @@ dwarf2_directive_loc (int dummy ATTRIBUTE_UNUSED)
   demand_empty_rest_of_line ();
   dwarf2_loc_directive_seen = TRUE;
   debug_type = DEBUG_NONE;
+
+  /* If we were given a view id, emit the row right away.  */
+  if (current.view)
+    dwarf2_emit_insn (0);
 }
 
 void
index 629e1a017ad7843ad7f6e06fc8c68440cd5845a2..9627ef513bf37b6ee20b98a7e3ac61b2f2991245 100644 (file)
@@ -37,7 +37,6 @@
 #include "macro.h"
 #include "obstack.h"
 #include "ecoff.h"
-#include "dwarf2dbg.h"
 #include "dw2gencfi.h"
 #include "wchar.h"
 
@@ -779,8 +778,6 @@ do_align (unsigned int n, char *fill, unsigned int len, unsigned int max)
   md_flush_pending_output ();
 #endif
 
-  dwarf2_emit_insn (0);
-
 #ifdef md_do_align
   md_do_align (n, fill, len, max, just_record_alignment);
 #endif
@@ -2201,8 +2198,6 @@ s_fill (int ignore ATTRIBUTE_UNUSED)
   md_flush_pending_output ();
 #endif
 
-  dwarf2_emit_insn (0);
-
 #ifdef md_cons_align
   md_cons_align (1);
 #endif
@@ -2853,8 +2848,6 @@ s_org (int ignore ATTRIBUTE_UNUSED)
   md_flush_pending_output ();
 #endif
 
-  dwarf2_emit_insn (0);
-
   /* The m68k MRI assembler has a different meaning for .org.  It
      means to create an absolute section at a given address.  We can't
      support that--use a linker script instead.  */
@@ -3325,8 +3318,6 @@ s_space (int mult)
   md_flush_pending_output ();
 #endif
 
-  dwarf2_emit_insn (0);
-
 #ifdef md_cons_align
   md_cons_align (1);
 #endif
@@ -3976,8 +3967,6 @@ cons_worker (int nbytes,  /* 1=.byte, 2=.word, 4=.long.  */
   md_flush_pending_output ();
 #endif
 
-  dwarf2_emit_insn (0);
-
   if (flag_mri)
     stop = mri_comment_field (&stopc);
 
@@ -4970,8 +4959,6 @@ float_cons (/* Clobbers input_line-pointer, checks end-of-line.  */
   md_flush_pending_output ();
 #endif
 
-  dwarf2_emit_insn (0);
-
 #ifdef md_cons_align
   md_cons_align (1);
 #endif
@@ -5395,8 +5382,6 @@ s_leb128 (int sign)
   md_flush_pending_output ();
 #endif
 
-  dwarf2_emit_insn (0);
-
   do
     {
       deferred_expression (&exp);
@@ -5466,8 +5451,6 @@ stringer (int bits_appendzero)
   md_flush_pending_output ();
 #endif
 
-  dwarf2_emit_insn (0);
-
 #ifdef md_cons_align
   md_cons_align (1);
 #endif
@@ -5862,8 +5845,6 @@ s_incbin (int x ATTRIBUTE_UNUSED)
   md_flush_pending_output ();
 #endif
 
-  dwarf2_emit_insn (0);
-
 #ifdef md_cons_align
   md_cons_align (1);
 #endif
index 76e3c6b8584689b23bdd521c6a517fde80f9921a..73bc3493b625b227c622ab2cb7a000b8529768b8 100644 (file)
@@ -25,8 +25,6 @@
 #include "subsegs.h"
 #include "obstack.h"
 
-#include "dwarf2dbg.h"
-
 frchainS *frchain_now;
 
 static struct obstack frchains;
@@ -82,10 +80,7 @@ subseg_set_rest (segT seg, subsegT subseg)
   mri_common_symbol = NULL;
 
   if (frag_now && frchain_now)
-    {
-      frchain_now->frch_frag_now = frag_now;
-      dwarf2_emit_insn (0);
-    }
+    frchain_now->frch_frag_now = frag_now;
 
   gas_assert (frchain_now == 0
          || frchain_now->frch_last == frag_now);
index 457f648951db7e9defc3bfb42dde4c492739512a..60c73e5a0a81aff53b5bcf825c82db2583096af0 100644 (file)
@@ -1,2 +1,2 @@
 [^:]*: Assembler messages:
-[^:]*:26: Error: view number mismatch
+[^:]*:25: Error: view number mismatch
index 43eb6065ae7291db7900b2f45ee1788f8cf37b25..7f107fa51483be9d988cbf890a2f1d425f5b1bd2 100644 (file)
@@ -1,2 +1,2 @@
 [^:]*: Assembler messages:
-[^:]*:31: Error: view number mismatch
+[^:]*:30: Error: view number mismatch