llvm / llvm-project

The LLVM Project is a collection of modular and reusable compiler and toolchain technologies.
http://llvm.org
Other
28.97k stars 11.94k forks source link

Provide -fno-alias, opposite of -fno-strict-alias #34017

Open llvmbot opened 7 years ago

llvmbot commented 7 years ago
Bugzilla Link 34669
Version unspecified
OS All
Reporter LLVM Bugzilla Contributor
CC @hfinkel

Extended Description

The '-fno-strict-alias' flag disables all alias semantics, which is useful for some applications where these would be violated. The opposite of this would be a useful addition, which would basically provide FORTRAN like aliasing semantics for C / C++, by adding an implicit 'restrict' to every pointer.

llvmbot commented 7 years ago

The '-fno-strict-alias' flag disables all alias semantics, which is useful for some applications where these would be violated. The opposite of this would be a useful addition, which would basically provide FORTRAN like aliasing semantics for C / C++, by adding an implicit 'restrict' to every pointer.

Every pointer, or only those pointers that are function arguments?

Every pointer (ideally, configurable, to only be for function arguments, but not required).

hfinkel commented 7 years ago

The '-fno-strict-alias' flag disables all alias semantics, which is useful for some applications where these would be violated. The opposite of this would be a useful addition, which would basically provide FORTRAN like aliasing semantics for C / C++, by adding an implicit 'restrict' to every pointer.

Every pointer, or only those pointers that are function arguments?

llvmbot commented 7 years ago

ICC provides this (I think it's still somewhat experimental, FWIW) under -fno-alias.