🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.arch
Article #1001

Re: reassociation and undefined behaviour (was: vector length CSR?)

#1001
From: Anton Ertl
Date: Tue, 01 Dec 2026 08:46
29 lines
2713 bytes
Michael S <already5chosen@yahoo.com> writes:
>On Mon, 30 Nov 2026 09:22:07 GMT
>anton@mips.complang.tuwien.ac.at (Anton Ertl) wrote:
>> This does not change anything about the fact that gcc does not
>> reassociate the supposedly optimization-friendly overflow-UB integers,
>> while it does reassociate integers where overflow is defined to
>> perform modulo arithmetics.
>
>Show me.

See <2026Nov22.101624@mips.complang.tuwien.ac.at>, to which you
replied yourself.

>I I spent dozens of minutes looking for such cases and did not find
>them.
>In all my tests gcc either generate poorly optimized latency bound code
>both for signed and unsigned integers

In the example shown above, gcc produces reassociated code with the
same tree-height as the original code.  I do not know why the authors
of the gcc reassociation transformation reassociate the computation in
this way, but I suspect that either a SPEC benchmark or a customer
application benefits from it.  I would expect that, on average,
minimizing the tree height is best.


-- 
'Anyone trying for "industrial quality" ISA should avoid undefined behavior.'
  Mitch Alsup, <c17fcd89-f024-40e7-a594-88a85ac10d20o@googlegroups.com>
Technical Details
Message-ID: <2026Dec1.094658@mips.complang.tuwien.ac.at>
Path: mbox-mo1.pugleaf.net!srv.newsdeef.eu!news.hispagatos.org!eternal-september.org!feeder.eternal-september.org!nntp.eternal-september.org!.POSTED!not-for-mail
References: <11cpqih$acf5$1@dont-email.me> <11cq2v7$dh5b$1@dont-email.me> <8jk1fl182pskj3fsmp4ju6qf420pgl0htg@4ax.com> <11csull$1ef6e$1@dont-email.me> <2026Nov9.230104@mips.complang.tuwien.ac.at> <11cvcr4$28k7g$1@dont-email.me> <11d3npt$3mmho$1@dont-email.me> <11dn936$2ebc2$1@dont-email.me> <11dndfd$2fr9j$1@dont-email.me> <2026Nov19.193817@mips.complang.tuwien.ac.at> <86o6b6kaqf.fsf@linuxsc.com> <2026Nov30.102207@mips.complang.tuwien.ac.at> <20261130235457.00006421@yahoo.com>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!srv.newsdeef.eu!news.hispagatos.org!eternal-september.org!feeder.eternal-september.org!nntp.eternal-september.org!.POSTED!not-for-mail
From: anton@mips.complang.tuwien.ac.at (Anton Ertl)
Newsgroups: comp.arch
Subject: Re: reassociation and undefined behaviour (was: vector length CSR?)
Date: Tue, 01 Dec 2026 08:46:58 GMT
Organization: Institut fuer Computersprachen, Technische Universitaet Wien
Lines: 29
Message-ID: <2026Dec1.094658@mips.complang.tuwien.ac.at>
References: <11cpqih$acf5$1@dont-email.me> <11cq2v7$dh5b$1@dont-email.me> <8jk1fl182pskj3fsmp4ju6qf420pgl0htg@4ax.com> <11csull$1ef6e$1@dont-email.me> <2026Nov9.230104@mips.complang.tuwien.ac.at> <11cvcr4$28k7g$1@dont-email.me> <11d3npt$3mmho$1@dont-email.me> <11dn936$2ebc2$1@dont-email.me> <11dndfd$2fr9j$1@dont-email.me> <2026Nov19.193817@mips.complang.tuwien.ac.at> <86o6b6kaqf.fsf@linuxsc.com> <2026Nov30.102207@mips.complang.tuwien.ac.at> <20261130235457.00006421@yahoo.com>
Injection-Date: Tue, 01 Dec 2026 08:55:20 +0000 (UTC)
Injection-Info: dont-email.me;
	logging-data="1483841"; mail-complaints-to="abuse@eternal-september.org";	posting-account="U2FsdGVkX1+Zpy0eMsaiNs4MFC/sw/gG"; posting-host="8e35d99638f608aa487eea8644675695"
Cancel-Lock: sha1:aA+jEj8J6MZmItgCOORdJHp8n30= sha256:0Mz6C+/KTeHEIl4QngVJXNq+pt+xIsayKSR5RGADkqo=
	sha1:5TkkOQuVSn/Vz+W+IlPBp5e4NrI= sha256:DZAU2/3Cgi5mEy+TqKsmcQgozIrigzwDAsufW5yah8o=
X-newsreader: xrn 10.11