dmd foreach loops throw exceptions on invalid UTF sequences, use replacementDchar instead

Walter Bright newshound2 at digitalmars.com
Sat Nov 6 01:09:49 UTC 2021


On 11/5/2021 5:40 PM, Andrei Alexandrescu wrote:
> Turns out the EH code is very well separated. Gcc goes so far as to generate two 
> separate functions, one for hot and one for cold. Clang also does a good job 
> separating the paths.

How does one decide in advance to call the non-throwing function?


> It happens in our metier that good judgment becomes prejudice. It seems that's 
> what happening with "exceptions are expensive" right now.

I remain skeptical.

My playing with gcc shows it moves the unwind blocks past the end of the 
function, which keeps them somewhat out of the hot path. Doesn't fix the 
register allocation problem, though.

BTW, dmd also moves the unwind blocks past the end.


More information about the Digitalmars-d mailing list