Re: Some regular-expression performance hacking

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Andres Freund <andres(at)anarazel(dot)de>
Cc: pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: Some regular-expression performance hacking
Date: 2021-02-23 17:39:09
Message-ID: 3874948.1614101949@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Andres Freund <andres(at)anarazel(dot)de> writes:
> One of the recent commits have introduce a new warning with gcc 10, when
> building with optimizations:

> In file included from /home/andres/src/postgresql/src/backend/regex/regcomp.c:2304:
> /home/andres/src/postgresql/src/backend/regex/regc_nfa.c: In function ‘checkmatchall’:
> /home/andres/src/postgresql/src/backend/regex/regc_nfa.c:3087:20: warning: array subscript -1 is outside array bounds of ‘_Bool[257]’ [-Warray-bounds]
> 3087 | hasmatch[depth] = true;
> | ^

Hmph. There's an "assert(depth >= 0)" immediately in front of that,
so I'm not looking too kindly on the compiler thinking it's smarter
than I am. Do you have a suggestion on how to shut it up?

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2021-02-23 17:52:28 Re: Some regular-expression performance hacking
Previous Message Mark Dilger 2021-02-23 17:38:29 Re: new heapcheck contrib module