On 2021-12-02 12:21, Vladimir Makarov via Gcc-patches wrote: > > On 2021-12-02 12:06, Vladimir Makarov wrote: >> >> >> So simple problem and so many details :) >>> This will require that long long is at least twice as large as int >>> everywhere, I thought you wanted to do that only when >>> __builtin_smul_overflow isn't available. >> >> That is not critical as GCC and probably all others C++ compiler >> support only targets with this assertion.  I guess it is better to >> find this problem earlier on targets (if any) where it is not true >> *independently* on used compiler. >> >> So it is difficult for me to know what is better.  Probably for >> GCC/Clang oriented world, your variant is better as it permits to >> compile the code by GCC even on targets where the assertion is false. >> >> > After some more considerations, I think you are right and the backup > code should be conditional.  Because otherwise, there is no sense to > use code with __builtin_smul_overflow.  I'll do the changes. > > Here is one more patch I've committed.  Jakub, thank your for the discussion and your patience.