diff mbox series

reg-notes.def: Fix up description of REG_NOALIAS

Message ID ZSe/UjWPIHPPUGyw@arm.com
State New
Headers show
Series reg-notes.def: Fix up description of REG_NOALIAS | expand

Commit Message

Alex Coplan Oct. 12, 2023, 9:41 a.m. UTC
Hi,

The description of the REG_NOALIAS note in reg-notes.def isn't quite
right. It describes it as being attached to call insns, but it is
instead attached to a move insn receiving the return value from a call.

This can be seen by looking at the code in calls.cc:expand_call which
attaches the note:

  emit_move_insn (temp, valreg);

  /* The return value from a malloc-like function cannot alias
     anything else.  */
  last = get_last_insn ();
  add_reg_note (last, REG_NOALIAS, temp);

Bootstrapped on aarch64-linux-gnu, OK for trunk?

Thanks,
Alex

gcc/ChangeLog:

        * reg-notes.def (NOALIAS): Correct comment.

Comments

Jeff Law Oct. 12, 2023, 4:02 p.m. UTC | #1
On 10/12/23 03:41, Alex Coplan wrote:
> Hi,
> 
> The description of the REG_NOALIAS note in reg-notes.def isn't quite
> right. It describes it as being attached to call insns, but it is
> instead attached to a move insn receiving the return value from a call.
> 
> This can be seen by looking at the code in calls.cc:expand_call which
> attaches the note:
> 
>    emit_move_insn (temp, valreg);
> 
>    /* The return value from a malloc-like function cannot alias
>       anything else.  */
>    last = get_last_insn ();
>    add_reg_note (last, REG_NOALIAS, temp);
> 
> Bootstrapped on aarch64-linux-gnu, OK for trunk?
> 
> Thanks,
> Alex
> 
> gcc/ChangeLog:
> 
>          * reg-notes.def (NOALIAS): Correct comment.
OK
jeff
diff mbox series

Patch

diff --git a/gcc/reg-notes.def b/gcc/reg-notes.def
index 1f74a605b3e..5cbe35dfe36 100644
--- a/gcc/reg-notes.def
+++ b/gcc/reg-notes.def
@@ -96,8 +96,9 @@  REG_NOTE (DEP_CONTROL)
    to extract the actual value.  */
 REG_NOTE (BR_PROB)
 
-/* Attached to a call insn; indicates that the call is malloc-like and
-   that the pointer returned cannot alias anything else.  */
+/* Attached to a move insn which receives the result of a call; indicates that
+   the call is malloc-like and that the pointer returned cannot alias anything
+   else.  */
 REG_NOTE (NOALIAS)
 
 /* REG_BR_PRED is attached to JUMP_INSNs.  It contains