BreadTom
BreadTom
> Hi [@BreadTom](https://github.com/BreadTom), I've started working on this issue. Could you please assign this issue to me? I don't have write permission. Thanks for working on this.
Clang, just like [GCC](https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68034), has no __builtin_memset_explicit, I think this should be added for C23 support.
At this similar [code](https://godbolt.org/z/6r8Wbv4bc), Both C code are the same in behavior, yet the first C source uses less instructions than the second.
> Perhaps there's no bug of Clang that needs to be fixed. IMO you've already found the fix of a bug in your code. But perhaps some diagnostic message is...
> I created a smaller example, the difference seems to be due to the difference is ordering of the `or` statement. In the case where the comparison to '_' occurs...
[Reduced godbolt code](https://godbolt.org/z/x91dodT3Y) ``` void f3(unsigned char *ptr){ if(ptr[0]) ptr[0] = 0; } ``` ``` define dso_local void @f3(ptr noundef captures(none) %ptr) local_unnamed_addr { entry: %0 = load i8, ptr...
> The proposed optimization is invalid, because it may introduce data races. What about if the pointer is restrict since LLVM now adds a noalias: ``` void f0(int * restrict...
> What about if the pointer is restrict since LLVM now adds a noalias: Misunderstood that restrict doesn't act like threading locking mechanism.
> [@BreadTom](https://github.com/BreadTom) Does this pattern exist in some real-world applications? It looks strange that a program assumes the overflow always occurs. I don't know if this shows up in real...
@RKSimon @liamsemeria