linux-sparse.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] no needs to use MARK_CURRENT_DELETED() for multi-jumps
@ 2021-04-17 13:31 Luc Van Oostenryck
  2021-04-17 16:18 ` Ramsay Jones
  0 siblings, 1 reply; 4+ messages in thread
From: Luc Van Oostenryck @ 2021-04-17 13:31 UTC (permalink / raw)
  To: linux-sparse; +Cc: Luc Van Oostenryck

MARK_CURRENT_DELETED() was added for the case(s) where an element
must be removed from the list but the address of the other elements
must not be changed. In this case of effectively removing the
element from it list, the element is 'marked' as deleted in the list
and the list walking macros will later take this in account.

However, this is not never needed for multi-jumps.

So, use the usual DELETE_CURRENT_PTR() for them.

Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
---
 simplify.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/simplify.c b/simplify.c
index 9e3514d838a9..30d053f708e3 100644
--- a/simplify.c
+++ b/simplify.c
@@ -2651,7 +2651,7 @@ static int simplify_cgoto(struct instruction *insn)
 				continue;
 			remove_bb_from_list(&jmp->target->parents, bb, 1);
 			remove_bb_from_list(&bb->children, jmp->target, 1);
-			MARK_CURRENT_DELETED(jmp);
+			DELETE_CURRENT_PTR(jmp);
 		} END_FOR_EACH_PTR(jmp);
 		kill_use(&insn->src);
 		insn->opcode = OP_BR;
-- 
2.31.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] no needs to use MARK_CURRENT_DELETED() for multi-jumps
  2021-04-17 13:31 [PATCH] no needs to use MARK_CURRENT_DELETED() for multi-jumps Luc Van Oostenryck
@ 2021-04-17 16:18 ` Ramsay Jones
  2021-04-17 16:38   ` Luc Van Oostenryck
  0 siblings, 1 reply; 4+ messages in thread
From: Ramsay Jones @ 2021-04-17 16:18 UTC (permalink / raw)
  To: Luc Van Oostenryck; +Cc: linux-sparse

On Sat, Apr 17, 2021 at 03:31:54PM +0200, Luc Van Oostenryck wrote:
> MARK_CURRENT_DELETED() was added for the case(s) where an element
> must be removed from the list but the address of the other elements
> must not be changed. In this case of effectively removing the
> element from it list, the element is 'marked' as deleted in the list
> and the list walking macros will later take this in account.
> 
> However, this is not never needed for multi-jumps.

s/not never/not ever/ ?

ATB,
Ramsay Jones

> 
> So, use the usual DELETE_CURRENT_PTR() for them.
> 
> Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
> ---
>  simplify.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/simplify.c b/simplify.c
> index 9e3514d838a9..30d053f708e3 100644
> --- a/simplify.c
> +++ b/simplify.c
> @@ -2651,7 +2651,7 @@ static int simplify_cgoto(struct instruction *insn)
>  				continue;
>  			remove_bb_from_list(&jmp->target->parents, bb, 1);
>  			remove_bb_from_list(&bb->children, jmp->target, 1);
> -			MARK_CURRENT_DELETED(jmp);
> +			DELETE_CURRENT_PTR(jmp);
>  		} END_FOR_EACH_PTR(jmp);
>  		kill_use(&insn->src);
>  		insn->opcode = OP_BR;
> -- 
> 2.31.1
> 

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] no needs to use MARK_CURRENT_DELETED() for multi-jumps
  2021-04-17 16:18 ` Ramsay Jones
@ 2021-04-17 16:38   ` Luc Van Oostenryck
  2021-04-17 17:46     ` Ramsay Jones
  0 siblings, 1 reply; 4+ messages in thread
From: Luc Van Oostenryck @ 2021-04-17 16:38 UTC (permalink / raw)
  To: Ramsay Jones; +Cc: linux-sparse

On Sat, Apr 17, 2021 at 05:18:31PM +0100, Ramsay Jones wrote:
> On Sat, Apr 17, 2021 at 03:31:54PM +0200, Luc Van Oostenryck wrote:
> > MARK_CURRENT_DELETED() was added for the case(s) where an element
> > must be removed from the list but the address of the other elements
> > must not be changed. In this case of effectively removing the
> > element from it list, the element is 'marked' as deleted in the list
> > and the list walking macros will later take this in account.
> > 
> > However, this is not never needed for multi-jumps.
> 
> s/not never/not ever/ ?

Hehe :) Thanks.
Just 's/not never/never/'

-- Luc

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] no needs to use MARK_CURRENT_DELETED() for multi-jumps
  2021-04-17 16:38   ` Luc Van Oostenryck
@ 2021-04-17 17:46     ` Ramsay Jones
  0 siblings, 0 replies; 4+ messages in thread
From: Ramsay Jones @ 2021-04-17 17:46 UTC (permalink / raw)
  To: Luc Van Oostenryck; +Cc: linux-sparse



On 17/04/2021 17:38, Luc Van Oostenryck wrote:
> On Sat, Apr 17, 2021 at 05:18:31PM +0100, Ramsay Jones wrote:
>> On Sat, Apr 17, 2021 at 03:31:54PM +0200, Luc Van Oostenryck wrote:
>>> MARK_CURRENT_DELETED() was added for the case(s) where an element
>>> must be removed from the list but the address of the other elements
>>> must not be changed. In this case of effectively removing the
>>> element from it list, the element is 'marked' as deleted in the list
>>> and the list walking macros will later take this in account.
>>>
>>> However, this is not never needed for multi-jumps.
>>
>> s/not never/not ever/ ?
> 
> Hehe :) Thanks.
> Just 's/not never/never/'

Heh, palmface, of course! ;-)

ATB,
Ramsay Jones



^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2021-04-17 17:46 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-17 13:31 [PATCH] no needs to use MARK_CURRENT_DELETED() for multi-jumps Luc Van Oostenryck
2021-04-17 16:18 ` Ramsay Jones
2021-04-17 16:38   ` Luc Van Oostenryck
2021-04-17 17:46     ` Ramsay Jones

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).