Hi Richard,

Since this appeared only in gcc13, I see no need for a backport.
I will also document this in the changes file.
The „problem“

It's a real problem, I am afraid...

is latent forever, I’m not sure it’s good to amend the kitchen-sink >std=legacy 
option with -fwrapv since that has quite some negative
effects on optimization.

So, what are the options?

Do nothing, and get silent bad results. I do not think we can do this,
there is too much code out there.  Just look at Numerical Recipes, which
has this kind of random number generator.

Apply the patch (with spelling fixes).  This has the drawback that
you outlined, potential impact on optimization.

Put a warning in the release notes.  This will not help in general
because 99.99% of users will not read it.

Revert the patch exposing the problem.  No.  That would pessimize
everything.

Put the optimization behind a special flag.  That also makes no sense,
-fwrapv does the job.

Would it be possible to add a warning?  Anything of the sort

a = b + c * a

where b and c are larger than (in this case) 16 bits could be flagged.

Other options?

Best regards

        Thomas

Reply via email to