Tomasz Kaminski [Monday, 20 October 2025, 16:19:02 CEST]:
> If the bug is in libstdc++ or a wrong-code bug in GCC, then yes, this is a
> 
> > problem. If the bug is in the user's code, then what difference does it
> > make?
> 
> I assume there is a possibility of situations when builtins will fail, but
> element-wise
> code will work. For example  when someone uses misaligned simd object, that
> was
> reinterpret casted from chunk of memory.
> In that case, the problem will disappear for non-optimized code.

That's hard to say. It can go both ways. But typically the non-constprop code 
would call a builtin, which is translated into a SIMD instruction, which then 
(might) require an aligned load address. The const-prop branch on the other 
might eliminate the SIMD instruction altogether and not crash.

Misalignment crashes are best debugged in -O2 anyway. (But that doesn't change 
any of what you said, I know.)

> Anyway, I am not asking you to remove it completely, just centralize the
> checks to one place.

I'm not objecting to that. I just wanted to add my perspective of the issue.

-- 
──────────────────────────────────────────────────────────────────────────
 Dr. Matthias Kretz                           https://mattkretz.github.io
 GSI Helmholtz Center for Heavy Ion Research               https://gsi.de
 std::simd
──────────────────────────────────────────────────────────────────────────

Reply via email to