This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug middle-end/48390] Multiple setting to restricted pointer variable not optimized away
- From: "vries at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Tue, 29 Sep 2015 08:03:44 +0000
- Subject: [Bug middle-end/48390] Multiple setting to restricted pointer variable not optimized away
- Auto-submitted: auto-generated
- References: <bug-48390-4 at http dot gcc dot gnu dot org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=48390
vries at gcc dot gnu.org changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |vries at gcc dot gnu.org
--- Comment #2 from vries at gcc dot gnu.org ---
(In reply to Tobias Burnus from comment #0)
> float
> foo (float * restrict a, float * restrict b, float * restrict c, float *ptr)
> {
> *a = 1; /* Can delete. */
> *b = *ptr + 2;
> *a = 3;
>
> return *a + *b;
> }
>
This is supported in current trunk, and the dead store '*a = 1' is removed.