Re: [PATCH] rtl: ICE with thread_local and inline asm [PR104777]

2022-03-08 Thread Segher Boessenkool
On Tue, Mar 08, 2022 at 05:12:43PM +0100, Jakub Jelinek wrote: > On Tue, Mar 08, 2022 at 09:49:15AM -0600, Segher Boessenkool wrote: > > > But like I said above, even if we didn't copy these XVECLEN 0 rtvecs, > > > the crash would not go away. > > > > An rtvec should never have length 0. Look at

Re: [PATCH] rtl: ICE with thread_local and inline asm [PR104777]

2022-03-08 Thread Marek Polacek via Gcc-patches
On Tue, Mar 08, 2022 at 05:12:43PM +0100, Jakub Jelinek wrote: > On Tue, Mar 08, 2022 at 09:49:15AM -0600, Segher Boessenkool wrote: > > > But like I said above, even if we didn't copy these XVECLEN 0 rtvecs, > > > the crash would not go away. > > > > An rtvec should never have length 0. Look at

Re: [PATCH] rtl: ICE with thread_local and inline asm [PR104777]

2022-03-08 Thread Jakub Jelinek via Gcc-patches
On Tue, Mar 08, 2022 at 09:49:15AM -0600, Segher Boessenkool wrote: > > But like I said above, even if we didn't copy these XVECLEN 0 rtvecs, > > the crash would not go away. > > An rtvec should never have length 0. Look at gen_rtvec for another > example. That is not true. In case of ASM_OPERA

Re: [PATCH] rtl: ICE with thread_local and inline asm [PR104777]

2022-03-08 Thread Marek Polacek via Gcc-patches
On Tue, Mar 08, 2022 at 09:49:15AM -0600, Segher Boessenkool wrote: > On Tue, Mar 08, 2022 at 10:25:45AM -0500, Marek Polacek wrote: > > On Tue, Mar 08, 2022 at 09:14:56AM -0600, Segher Boessenkool wrote: > > > On Tue, Mar 08, 2022 at 10:08:25AM -0500, Marek Polacek wrote: > > > > ...I don't see th

Re: [PATCH] rtl: ICE with thread_local and inline asm [PR104777]

2022-03-08 Thread Segher Boessenkool
On Tue, Mar 08, 2022 at 10:25:45AM -0500, Marek Polacek wrote: > On Tue, Mar 08, 2022 at 09:14:56AM -0600, Segher Boessenkool wrote: > > On Tue, Mar 08, 2022 at 10:08:25AM -0500, Marek Polacek wrote: > > > ...I don't see that. In fact copy_rtx does the same thing as > > > copy_insn: > > > > > >

Re: [PATCH] rtl: ICE with thread_local and inline asm [PR104777]

2022-03-08 Thread Marek Polacek via Gcc-patches
On Tue, Mar 08, 2022 at 09:14:56AM -0600, Segher Boessenkool wrote: > Hi! > > On Tue, Mar 08, 2022 at 10:08:25AM -0500, Marek Polacek wrote: > > On Mon, Mar 07, 2022 at 07:19:09PM -0600, Segher Boessenkool wrote: > > > On Mon, Mar 07, 2022 at 07:03:17PM -0500, Marek Polacek via Gcc-patches > > >

Re: [PATCH] rtl: ICE with thread_local and inline asm [PR104777]

2022-03-08 Thread Segher Boessenkool
Hi! On Tue, Mar 08, 2022 at 10:08:25AM -0500, Marek Polacek wrote: > On Mon, Mar 07, 2022 at 07:19:09PM -0600, Segher Boessenkool wrote: > > On Mon, Mar 07, 2022 at 07:03:17PM -0500, Marek Polacek via Gcc-patches > > wrote: > > > In r270550, Jakub fixed classify_insn to handle asm goto: if the as

Re: [PATCH] rtl: ICE with thread_local and inline asm [PR104777]

2022-03-08 Thread Marek Polacek via Gcc-patches
On Mon, Mar 07, 2022 at 07:19:09PM -0600, Segher Boessenkool wrote: > On Mon, Mar 07, 2022 at 07:03:17PM -0500, Marek Polacek via Gcc-patches wrote: > > In r270550, Jakub fixed classify_insn to handle asm goto: if the asm can > > jump to a label, the insn should be a JUMP_INSN. > > > > However, as

Re: [PATCH] rtl: ICE with thread_local and inline asm [PR104777]

2022-03-07 Thread Segher Boessenkool
On Mon, Mar 07, 2022 at 07:03:17PM -0500, Marek Polacek via Gcc-patches wrote: > In r270550, Jakub fixed classify_insn to handle asm goto: if the asm can > jump to a label, the insn should be a JUMP_INSN. > > However, as the following testcase shows, non-null ASM_OPERANDS_LABEL_VEC > doesn't guara

[PATCH] rtl: ICE with thread_local and inline asm [PR104777]

2022-03-07 Thread Marek Polacek via Gcc-patches
In r270550, Jakub fixed classify_insn to handle asm goto: if the asm can jump to a label, the insn should be a JUMP_INSN. However, as the following testcase shows, non-null ASM_OPERANDS_LABEL_VEC doesn't guarantee that the rtx has any actual labels it can branch to. Here, the rtvec has 0 elements