pg.ddx.io pgsql-committers@postgresql.org mailing list archivehelp / color / mirror / Atom feed
pgsql: Don't depend on -fwrapv semantics in pgbench's random() function 4+ messages / 1 participants [nested] [flat]
* pgsql: Don't depend on -fwrapv semantics in pgbench's random() function @ 2021-06-28 16:41 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 4+ messages in thread From: Tom Lane @ 2021-06-28 16:41 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Don't depend on -fwrapv semantics in pgbench's random() function. Instead use the common/int.h functions to check for integer overflow in a more C-standard-compliant fashion. This is motivated by recent failures on buildfarm member moonjelly, where it appears that development-tip gcc is optimizing without regard to the -fwrapv switch. Presumably that's a gcc bug that will be fixed soon, but we might as well install cleaner coding here rather than wait. (This does not address the question of whether we'll ever be able to get rid of using -fwrapv. Testing shows that this spot is the only place where doing so creates visible regression test failures, but unfortunately that proves very little.) Back-patch to v12. The common/int.h functions exist in v11, but that branch doesn't use them in any client-side code. I judge that this case isn't interesting enough in the real world to take even a small risk of issues from being the first such use. Tom Lane and Fabien Coelho Discussion: https://postgr.es/m/73927.1624815543@sss.pgh.pa.us Branch ------ master Details ------- https://git.postgresql.org/pg/commitdiff/01697e92a460b10fde43707b29391c8deb69573e Modified Files -------------- src/bin/pgbench/pgbench.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) ^ permalink raw reply [nested|flat] 4+ messages in thread
* pgsql: Don't depend on -fwrapv semantics in pgbench's random() function @ 2021-06-28 16:41 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 4+ messages in thread From: Tom Lane @ 2021-06-28 16:41 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Don't depend on -fwrapv semantics in pgbench's random() function. Instead use the common/int.h functions to check for integer overflow in a more C-standard-compliant fashion. This is motivated by recent failures on buildfarm member moonjelly, where it appears that development-tip gcc is optimizing without regard to the -fwrapv switch. Presumably that's a gcc bug that will be fixed soon, but we might as well install cleaner coding here rather than wait. (This does not address the question of whether we'll ever be able to get rid of using -fwrapv. Testing shows that this spot is the only place where doing so creates visible regression test failures, but unfortunately that proves very little.) Back-patch to v12. The common/int.h functions exist in v11, but that branch doesn't use them in any client-side code. I judge that this case isn't interesting enough in the real world to take even a small risk of issues from being the first such use. Tom Lane and Fabien Coelho Discussion: https://postgr.es/m/73927.1624815543@sss.pgh.pa.us Branch ------ REL_14_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/203c5aaaba56715168c1e80a45d4929120c9281b Modified Files -------------- src/bin/pgbench/pgbench.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) ^ permalink raw reply [nested|flat] 4+ messages in thread
* pgsql: Don't depend on -fwrapv semantics in pgbench's random() function @ 2021-06-28 16:41 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 4+ messages in thread From: Tom Lane @ 2021-06-28 16:41 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Don't depend on -fwrapv semantics in pgbench's random() function. Instead use the common/int.h functions to check for integer overflow in a more C-standard-compliant fashion. This is motivated by recent failures on buildfarm member moonjelly, where it appears that development-tip gcc is optimizing without regard to the -fwrapv switch. Presumably that's a gcc bug that will be fixed soon, but we might as well install cleaner coding here rather than wait. (This does not address the question of whether we'll ever be able to get rid of using -fwrapv. Testing shows that this spot is the only place where doing so creates visible regression test failures, but unfortunately that proves very little.) Back-patch to v12. The common/int.h functions exist in v11, but that branch doesn't use them in any client-side code. I judge that this case isn't interesting enough in the real world to take even a small risk of issues from being the first such use. Tom Lane and Fabien Coelho Discussion: https://postgr.es/m/73927.1624815543@sss.pgh.pa.us Branch ------ REL_13_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/be567deb3ac952e41edc81b8c08a0dc6115c5f62 Modified Files -------------- src/bin/pgbench/pgbench.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) ^ permalink raw reply [nested|flat] 4+ messages in thread
* pgsql: Don't depend on -fwrapv semantics in pgbench's random() function @ 2021-06-28 16:41 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 4+ messages in thread From: Tom Lane @ 2021-06-28 16:41 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Don't depend on -fwrapv semantics in pgbench's random() function. Instead use the common/int.h functions to check for integer overflow in a more C-standard-compliant fashion. This is motivated by recent failures on buildfarm member moonjelly, where it appears that development-tip gcc is optimizing without regard to the -fwrapv switch. Presumably that's a gcc bug that will be fixed soon, but we might as well install cleaner coding here rather than wait. (This does not address the question of whether we'll ever be able to get rid of using -fwrapv. Testing shows that this spot is the only place where doing so creates visible regression test failures, but unfortunately that proves very little.) Back-patch to v12. The common/int.h functions exist in v11, but that branch doesn't use them in any client-side code. I judge that this case isn't interesting enough in the real world to take even a small risk of issues from being the first such use. Tom Lane and Fabien Coelho Discussion: https://postgr.es/m/73927.1624815543@sss.pgh.pa.us Branch ------ REL_12_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/3fd334795e268ad49a48bde8fdba69b9a19f08cb Modified Files -------------- src/bin/pgbench/pgbench.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) ^ permalink raw reply [nested|flat] 4+ messages in thread
end of thread, other threads:[~2021-06-28 16:41 UTC | newest] Thread overview: 4+ messages (download: mbox mbox.gz follow: Atom feed) -- links below jump to the message on this page -- 2021-06-28 16:41 pgsql: Don't depend on -fwrapv semantics in pgbench's random() function Tom Lane <tgl@sss.pgh.pa.us> 2021-06-28 16:41 pgsql: Don't depend on -fwrapv semantics in pgbench's random() function Tom Lane <tgl@sss.pgh.pa.us> 2021-06-28 16:41 pgsql: Don't depend on -fwrapv semantics in pgbench's random() function Tom Lane <tgl@sss.pgh.pa.us> 2021-06-28 16:41 pgsql: Don't depend on -fwrapv semantics in pgbench's random() function Tom Lane <tgl@sss.pgh.pa.us>
This inbox is served by DDX for PostgreSQL; see mirroring instructions for how to clone and mirror all data and code used for this inbox