In http://reviews.llvm.org/D8548#145253, @mkuper wrote:

> I think PureAttr isn't strong enough.
>
> char foo(char *a)
>  {
>
>   return *a;
>
> }
>
> is pure, but isn't side-effect free.


Loads are not considered side effects currently, however. This works fine:

  void bar(int *i) {
    __builtin_assume(*i > 0);
  }

and, thus, my recommendation ;)


http://reviews.llvm.org/D8548

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/



_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits

Reply via email to