On Tue, Oct 13, 2020 at 10:36 AM Tamar Christina via Gcc-patches <gcc-patches@gcc.gnu.org> wrote: > > Hi, > > I am sending some old patches that we have internally since GCC 10 to the Arm > Branch but feel free to comment as we will be looking to submit them for GCC > 12 to mainline. > > This patch adds the option '-fno-alias'. The option makes the compiler treat > any pointer being passed as a parameter as if it had the keyword restrict. > This option makes it easier to check whether using restrict gives a > performance boost, without having to change the sources. > Of course this option can only be used if you know for a fact that all > pointers do not alias, or just like with the restrict keyword, things can go > very wrong. > > The way this patch implements this option is when the option is passed, > create a qualified pointer type for any pointer type encountered as a > parameter. > This qualified pointer type will have the TYPE_QUAL_RESTRICT bit set, just as > if we had parsed a 'restrict' keyword. > > Bootstraped on aarch64-none-linux-gnu, to make sure I didn't break anything > obvious in the build. > > Is this OK for trunk?
-fno-alias is a very unspecific name. We've formerly had fargument-noalias Common Ignore Does nothing. Preserved for backward compatibility. fargument-noalias-global Common Ignore Does nothing. Preserved for backward compatibility. fargument-noalias-anything Common Ignore Does nothing. Preserved for backward compatibility. and you might want to dive into history as to why we removed those. So - no, please not. Thanks, Richard. > gcc/ChangeLog: > > 2020-xx-xx Andre Vieira <andre.simoesdiasvie...@arm.com> > > * common.opt (fno-alias): New option. > * c/cdecl.c (grokdeclarator): When flag_no_alias make all > pointers passed as parameters restrict. > * cp/decl.c (grokdeclarator): Likewise. > * doc/invoke.texi (fno-alias): Document new option. > > gcc/testsuite/ChangeLog: > > 2020-xx-xx Andre Vieira <andre.simoesdiasvie...@arm.com> > > * gcc.dg/vect/vect-no-alias.c: New test. > * gcc.dg/vect/noalias.h: New include file used in test. > * g++.dg/vect/simd-no-alias.cc: New test. > > --