diff mbox

Fix doc about meaning of (pc) in length calculation

Message ID 236447222.E727LNkF59@polaris
State New
Headers show

Commit Message

Eric Botcazou Dec. 11, 2014, 10:34 p.m. UTC
The doc reads:

`(pc)'
     This refers to the address of the _current_ insn.  It might have
     been more consistent with other usage to make this the address of
     the _next_ insn but this would be confusing because the length of
     the current insn is to be computed.

That's incorrect for forward branches, (pc) points to the next insn for them, 
this is what final.c:insn_current_reference_address implements.

I presume that's a quirk known in circles of seasoned GCC hackers for long, 
but I just ran into it and that's a little surprising...

Tested on x86_64-suse-linux, applied on all active branches.


2014-12-11  Eric Botcazou  <ebotcazou@adacore.com>

	* doc/md.texi (Insn Lengths): Fix description of (pc).
diff mbox

Patch

Index: doc/md.texi
===================================================================
--- doc/md.texi	(revision 218617)
+++ doc/md.texi	(working copy)
@@ -8330,9 +8330,9 @@  must be a @code{label_ref}.
 
 @cindex @code{pc} and attributes
 @item (pc)
-This refers to the address of the @emph{current} insn.  It might have
-been more consistent with other usage to make this the address of the
-@emph{next} insn but this would be confusing because the length of the
+For non-branch instructions and backward branch instructions, this refers
+to the address of the current insn.  But for forward branch instructions,
+this refers to the address of the next insn, because the length of the
 current insn is to be computed.
 @end table