Re: [committed] [PR99680] Check empty constraint before using CONSTRAINT_LEN.

2021-03-22 Thread Segher Boessenkool
On Mon, Mar 22, 2021 at 10:28:48AM -0400, Vladimir Makarov wrote: > On 2021-03-22 6:22 a.m., Richard Sandiford wrote: > >'\0' is just a normal string null terminator and so I don't think we > >should be processing it as if it were a constraint character. > >How about having a gcc_unreachable on zer

Re: [committed] [PR99680] Check empty constraint before using CONSTRAINT_LEN.

2021-03-22 Thread Segher Boessenkool
On Mon, Mar 22, 2021 at 10:22:55AM +, Richard Sandiford wrote: > Segher Boessenkool writes: > > On Sat, Mar 20, 2021 at 10:53:32AM -0400, Vladimir Makarov via Gcc-patches > > wrote: > >> It seems CONSTRAINT_LEN treats constraint '\0' as one having length 1. > > > > Maybe we should fix that?

Re: [committed] [PR99680] Check empty constraint before using CONSTRAINT_LEN.

2021-03-22 Thread Vladimir Makarov via Gcc-patches
On 2021-03-22 6:22 a.m., Richard Sandiford wrote: '\0' is just a normal string null terminator and so I don't think we should be processing it as if it were a constraint character. How about having a gcc_unreachable on zero instead? I would be nice to use gcc_unreachable but it requires to re

Re: [committed] [PR99680] Check empty constraint before using CONSTRAINT_LEN.

2021-03-22 Thread Richard Sandiford via Gcc-patches
Segher Boessenkool writes: > Hi! > > On Sat, Mar 20, 2021 at 10:53:32AM -0400, Vladimir Makarov via Gcc-patches > wrote: >> It seems CONSTRAINT_LEN treats constraint '\0' as one having length 1. > > Maybe we should fix that? See attached patch. I don't strongly object, but CONSTRAINT_LEN (0) do

Re: [committed] [PR99680] Check empty constraint before using CONSTRAINT_LEN.

2021-03-21 Thread Segher Boessenkool
Hi! On Sat, Mar 20, 2021 at 10:53:32AM -0400, Vladimir Makarov via Gcc-patches wrote: > It seems CONSTRAINT_LEN treats constraint '\0' as one having length 1. Maybe we should fix that? See attached patch. Segher diff --git a/gcc/genpreds.c b/gcc/genpreds.c index 8499a2a2383b..b83a030d6a5d 1

[committed] [PR99680] Check empty constraint before using CONSTRAINT_LEN.

2021-03-20 Thread Vladimir Makarov via Gcc-patches
The following patch fixes https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99680 The patch was successfully bootstrapped on x86-64. commit c1ab0c0336d85f5e97739060ecf77fd05ac86d2a Author: Vladimir N. Makarov Date: Sat Mar 20 10:50:03 2021 -0400 [PR99680] Check empty constraint before using