This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/48885] missed optimization with restrict qualifier?
- From: "paulo at matos-sorge dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Wed, 28 Aug 2013 14:02:22 +0000
- Subject: [Bug c/48885] missed optimization with restrict qualifier?
- Auto-submitted: auto-generated
- References: <bug-48885-4 at http dot gcc dot gnu dot org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48885
Paulo J. Matos <paulo@matos-sorge.com> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |paulo@matos-sorge.com
--- Comment #3 from Paulo J. Matos <paulo@matos-sorge.com> ---
My understanding is that for restrict optimization to take effect, variable a
has also to be restrict. Otherwise in the first assignment *a = *v;, a could
point to the same memory as v and therefore overwrite it, rendering the value
of *v in *b = *v; invalid. I think gcc is now doing the right thing.