From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 110208 invoked by alias); 14 Oct 2015 07:28:14 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org Received: (qmail 107954 invoked by uid 48); 14 Oct 2015 07:28:10 -0000 From: "rguenth at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/67955] tree-dse does not use pointer info Date: Wed, 14 Oct 2015 07:28:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: tree-optimization X-Bugzilla-Version: 6.0 X-Bugzilla-Keywords: alias, missed-optimization X-Bugzilla-Severity: enhancement X-Bugzilla-Who: rguenth at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: keywords bug_status cf_reconfirmed_on everconfirmed Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-SW-Source: 2015-10/txt/msg01073.txt.bz2 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67955 Richard Biener changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords| |alias, missed-optimization Status|UNCONFIRMED |NEW Last reconfirmed| |2015-10-14 Ever confirmed|0 |1 --- Comment #3 from Richard Biener --- (In reply to vries from comment #2) > (In reply to Richard Biener from comment #1) > > The same points-to set results from > > > > int *p = (int *)((char *)&a + 2); > > > > or even > > > > int *p = &a + 1; > > > > I see, I didn't realize that. But AFAICT, in both these cases, storing to *p > is illegal (if 'a' is a scalar int). > > > so you can't use points-to info that way (to derive a must-alias). > > I see your point related to an array object, there pointers to different > array elements would have identical points-to sets. > > I wonder though: if we have a store '*p = 0', and the size of the store is > the same as the size of the pointed-to object of pointer p, can't we > conclude that pointer p points to the start of the object? Yes, for that special case we indeed can do that. I wonder if it's worth doing though ;) Care to adjust stmt_kills_ref_p accordingly and instrument it to see how many times during bootstrap this triggers?