Deutsch   English   Français   Italiano  
<vb00c2$150ia$1@dont-email.me>

View for Bookmarking (what is this?)
Look up another Usenet article

Path: ...!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: Bernd Linsel <bl1-thispartdoesnotbelonghere@gmx.com>
Newsgroups: comp.arch
Subject: Re: Computer architects leaving Intel...
Date: Sat, 31 Aug 2024 23:01:54 +0200
Organization: A noiseless patient Spider
Lines: 50
Message-ID: <vb00c2$150ia$1@dont-email.me>
References: <2024Aug30.161204@mips.complang.tuwien.ac.at>
 <memo.20240830164247.19028y@jgd.cix.co.uk> <vasruo$id3b$1@dont-email.me>
 <2024Aug30.195831@mips.complang.tuwien.ac.at> <vat5ap$jthk$2@dont-email.me>
 <vaunhb$vckc$1@dont-email.me> <vautmu$vr5r$1@dont-email.me>
 <2024Aug31.170347@mips.complang.tuwien.ac.at> <vavpnh$13tj0$2@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Sat, 31 Aug 2024 23:01:55 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="45ab6619ef85b2365705a908f791e928";
	logging-data="1213002"; mail-complaints-to="abuse@eternal-september.org";	posting-account="U2FsdGVkX1/PDv9OgPStZJq7Tr+EkEX5"
User-Agent: Betterbird (Linux)
Cancel-Lock: sha1:FK9dFv6DKGL4M32YgAsWyhNCalY=
Content-Language: en-US
In-Reply-To: <vavpnh$13tj0$2@dont-email.me>
Bytes: 3661

On 31.08.24 21:08, Thomas Koenig wrote:
> Anton Ertl <anton@mips.complang.tuwien.ac.at> schrieb:
> 
>> Of course the fans of compilers that do what nobody means found a
>> counterargument long ago: They claim that compilers would need psychic
>> powers to know what you mean.
> 
> Of course, different compiler writers have different opinions, but
> what you write is very close to a straw man argument.
> 
> What compiler writers generlly agree upon is that specifications
> matter (either in the language standard or in documented behavior
> of the compiler).  Howewer, the concept of a  specification is
> something that you do not appear to understand, and maybe never
> will.
> 
> An example: I work in the chemical industry.  If a pressure vessel
> is rated for 16 bar overpressure, we are not allowed to run it at
> 32 bar. If the supplier happens to have sold vessels which can
> actually withstand 32 bar, and then makes modifications which
> lower the actual pressure the vessel can withstand only 16 bar,
> the customer has no cause for complaint.
> 
> As usual, the specification goes both ways:  The supplier
> guarantees the pressure rating, and the customer is obliged
> (by law, in this case) to never operate the vessel above its
> pressure rating.  Hence, safety valves rupture discs.

You compare apples and peaches. Technical specifications for your 
pressure vessel result from the physical abilities of the chosen 
material, by keeping requirements as vessel border width, geometry etc., 
while compiler writers are free in their search for optimization tricks 
that let them shine at SPEC benchmarks.

I personally write most code as in the days I learned C, where compilers 
where literally too dumb to remember what they did 2 source lines ago, 
so you could not rely on the compiler doing the "right thing" -- same as 
nowadays, but because of other reasons.

So the things that Anton mentioned -- using size_t (or suitable other 
unsigned types) for iteration variables, pulling invariants out of 
loops, and many more common optimizations -- can still be found in my 
source codes.

PS: I find -fno-strict-overflow and -fno-strict-aliasing of value, too, 
while I found that -fdelete-null-pointer-checks together with 
-Wnull-pointer-dereference has some utility.

-- 
Bernd Linsel