From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11491 invoked by alias); 2 Mar 2015 11:50:39 -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 11415 invoked by uid 48); 2 Mar 2015 11:50:33 -0000 From: "rguenth at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug ipa/65270] [5 regression] ICF needs to match TYPE attributes on memory accesses Date: Mon, 02 Mar 2015 11:50:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: ipa X-Bugzilla-Version: 5.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: rguenth at gcc dot gnu.org X-Bugzilla-Status: ASSIGNED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: rguenth at gcc dot gnu.org X-Bugzilla-Target-Milestone: 5.0 X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: 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-03/txt/msg00121.txt.bz2 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65270 --- Comment #2 from Richard Biener --- In theory comparing the object alignment with sth like unsigned int align1, align2; unsigned HOST_WIDE_INT tem; get_object_alignment_1 (t1, &align1, &tem); get_object_alignment_1 (t2, &align2, &tem); if (align1 != align2) return return_false_with_msg ("different access alignment"); should work, but in this case with variable offset we don't represent "unknown misalign offset" and thus fail to see the difference here. Thus we have to compare alignment of the base object here (but then not that from ao_ref_base because that's too aggressive in stripping MEM_REFs). I have a patch.