craig.topper added inline comments.

================
Comment at: clang/lib/Headers/ia32intrin.h:421
+    if (__c != 0) {                                                            
\
+      *(a) = (unsigned)__bsfd(__c);                                            
\
+      __d = 1;                                                                 
\
----------------
skan wrote:
> craig.topper wrote:
> > Should (a) have a cast to (unsigned *)?
> No. Using a cast here may cause pointer aliasing problem. 
> 
> https://stackoverflow.com/questions/98650/what-is-the-strict-aliasing-rule
> 
> If a is not `unsigned *`, letting the compiler do auto integer conversion for 
> `*(a)` is the correct way, from my perspective.
But if we implemented this as an inline function instead of a macro wouldn't 
the argument have been an unsigned *?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D75723/new/

https://reviews.llvm.org/D75723



_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to