Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lEbeV-0003kT-Rg for pgsql-hackers@arkaria.postgresql.org; Tue, 23 Feb 2021 17:39:15 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1lEbeU-0007G4-JM for pgsql-hackers@arkaria.postgresql.org; Tue, 23 Feb 2021 17:39:14 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lEbeU-0007Fx-Ca for pgsql-hackers@lists.postgresql.org; Tue, 23 Feb 2021 17:39:14 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lEbeS-0006zx-D2 for pgsql-hackers@lists.postgresql.org; Tue, 23 Feb 2021 17:39:14 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 11NHd9hc3874949; Tue, 23 Feb 2021 12:39:09 -0500 From: Tom Lane To: Andres Freund cc: pgsql-hackers@lists.postgresql.org Subject: Re: Some regular-expression performance hacking In-reply-to: <20210223173437.b3ywijygsy6q42gq@alap3.anarazel.de> References: <1340281.1613018383@sss.pgh.pa.us> <20210223173437.b3ywijygsy6q42gq@alap3.anarazel.de> Comments: In-reply-to Andres Freund message dated "Tue, 23 Feb 2021 09:34:37 -0800" MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-ID: <3874947.1614101949.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Tue, 23 Feb 2021 12:39:09 -0500 Message-ID: <3874948.1614101949@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Andres Freund 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/regc= omp.c:2304: > /home/andres/src/postgresql/src/backend/regex/regc_nfa.c: In function =E2= =80=98checkmatchall=E2=80=99: > /home/andres/src/postgresql/src/backend/regex/regc_nfa.c:3087:20: warnin= g: array subscript -1 is outside array bounds of =E2=80=98_Bool[257]=E2=80= =99 [-Warray-bounds] > 3087 | hasmatch[depth] =3D true; > | ^ Hmph. There's an "assert(depth >=3D 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