diff mbox series

Tweak documentation of ASM_INPUT_P

Message ID mptplptnawk.fsf@arm.com
State New
Headers show
Series Tweak documentation of ASM_INPUT_P | expand

Commit Message

Richard Sandiford Aug. 27, 2024, 5:16 p.m. UTC
The documentation of ASM_INPUT_P implied that the flag has no
effect on ASM_EXPRs that have operands (and which therefore must be
extended asms).  In fact we require ASM_INPUT_P to be false for all
extended asms.

Tested on aarch64-linux-gnu.  OK to install?

Richard


gcc/
	* tree.h (ASM_INPUT_P): Fix documentation.
---
 gcc/tree.h | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

Comments

Richard Biener Aug. 28, 2024, 6:57 a.m. UTC | #1
On Tue, Aug 27, 2024 at 7:17 PM Richard Sandiford
<richard.sandiford@arm.com> wrote:
>
> The documentation of ASM_INPUT_P implied that the flag has no
> effect on ASM_EXPRs that have operands (and which therefore must be
> extended asms).  In fact we require ASM_INPUT_P to be false for all
> extended asms.

Quite a bad name for a flag give there's also ASM_INPUTS ...

> Tested on aarch64-linux-gnu.  OK to install?

OK.  I notice that generic.texi while talking about basic asms, does not
mention ASM_INPUT_P.

Richard.

> Richard
>
>
> gcc/
>         * tree.h (ASM_INPUT_P): Fix documentation.
> ---
>  gcc/tree.h | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/gcc/tree.h b/gcc/tree.h
> index 5dcbb2fb5dd..c501019717f 100644
> --- a/gcc/tree.h
> +++ b/gcc/tree.h
> @@ -1428,8 +1428,9 @@ class auto_suppress_location_wrappers
>  #define ASM_INPUTS(NODE)        TREE_OPERAND (ASM_EXPR_CHECK (NODE), 2)
>  #define ASM_CLOBBERS(NODE)      TREE_OPERAND (ASM_EXPR_CHECK (NODE), 3)
>  #define ASM_LABELS(NODE)       TREE_OPERAND (ASM_EXPR_CHECK (NODE), 4)
> -/* Nonzero if we want to create an ASM_INPUT instead of an
> -   ASM_OPERAND with no operands.  */
> +/* Nonzero if the asm is a basic asm, zero if it is an extended asm.
> +   Basic asms use a plain ASM_INPUT insn pattern whereas extended asms
> +   use an ASM_OPERANDS insn pattern.  */
>  #define ASM_INPUT_P(NODE) (ASM_EXPR_CHECK (NODE)->base.static_flag)
>  #define ASM_VOLATILE_P(NODE) (ASM_EXPR_CHECK (NODE)->base.public_flag)
>  /* Nonzero if we want to consider this asm as minimum length and cost
> --
> 2.25.1
>
Richard Sandiford Aug. 28, 2024, 2:45 p.m. UTC | #2
Richard Biener <richard.guenther@gmail.com> writes:
> On Tue, Aug 27, 2024 at 7:17 PM Richard Sandiford
> <richard.sandiford@arm.com> wrote:
>>
>> The documentation of ASM_INPUT_P implied that the flag has no
>> effect on ASM_EXPRs that have operands (and which therefore must be
>> extended asms).  In fact we require ASM_INPUT_P to be false for all
>> extended asms.
>
> Quite a bad name for a flag give there's also ASM_INPUTS ...

Yeah, true.  I'll post a couple of follow-on patches to rename it

>> Tested on aarch64-linux-gnu.  OK to install?
>
> OK.  I notice that generic.texi while talking about basic asms, does not
> mention ASM_INPUT_P.

...and to fix this too.

Thanks for the review, now pushed.

Richard

>
> Richard.
>
>> Richard
>>
>>
>> gcc/
>>         * tree.h (ASM_INPUT_P): Fix documentation.
>> ---
>>  gcc/tree.h | 5 +++--
>>  1 file changed, 3 insertions(+), 2 deletions(-)
>>
>> diff --git a/gcc/tree.h b/gcc/tree.h
>> index 5dcbb2fb5dd..c501019717f 100644
>> --- a/gcc/tree.h
>> +++ b/gcc/tree.h
>> @@ -1428,8 +1428,9 @@ class auto_suppress_location_wrappers
>>  #define ASM_INPUTS(NODE)        TREE_OPERAND (ASM_EXPR_CHECK (NODE), 2)
>>  #define ASM_CLOBBERS(NODE)      TREE_OPERAND (ASM_EXPR_CHECK (NODE), 3)
>>  #define ASM_LABELS(NODE)       TREE_OPERAND (ASM_EXPR_CHECK (NODE), 4)
>> -/* Nonzero if we want to create an ASM_INPUT instead of an
>> -   ASM_OPERAND with no operands.  */
>> +/* Nonzero if the asm is a basic asm, zero if it is an extended asm.
>> +   Basic asms use a plain ASM_INPUT insn pattern whereas extended asms
>> +   use an ASM_OPERANDS insn pattern.  */
>>  #define ASM_INPUT_P(NODE) (ASM_EXPR_CHECK (NODE)->base.static_flag)
>>  #define ASM_VOLATILE_P(NODE) (ASM_EXPR_CHECK (NODE)->base.public_flag)
>>  /* Nonzero if we want to consider this asm as minimum length and cost
>> --
>> 2.25.1
>>
diff mbox series

Patch

diff --git a/gcc/tree.h b/gcc/tree.h
index 5dcbb2fb5dd..c501019717f 100644
--- a/gcc/tree.h
+++ b/gcc/tree.h
@@ -1428,8 +1428,9 @@  class auto_suppress_location_wrappers
 #define ASM_INPUTS(NODE)        TREE_OPERAND (ASM_EXPR_CHECK (NODE), 2)
 #define ASM_CLOBBERS(NODE)      TREE_OPERAND (ASM_EXPR_CHECK (NODE), 3)
 #define ASM_LABELS(NODE)	TREE_OPERAND (ASM_EXPR_CHECK (NODE), 4)
-/* Nonzero if we want to create an ASM_INPUT instead of an
-   ASM_OPERAND with no operands.  */
+/* Nonzero if the asm is a basic asm, zero if it is an extended asm.
+   Basic asms use a plain ASM_INPUT insn pattern whereas extended asms
+   use an ASM_OPERANDS insn pattern.  */
 #define ASM_INPUT_P(NODE) (ASM_EXPR_CHECK (NODE)->base.static_flag)
 #define ASM_VOLATILE_P(NODE) (ASM_EXPR_CHECK (NODE)->base.public_flag)
 /* Nonzero if we want to consider this asm as minimum length and cost