From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 19907 invoked by alias); 11 Sep 2007 17:21:35 -0000 Received: (qmail 19844 invoked by uid 48); 11 Sep 2007 17:21:24 -0000 Date: Tue, 11 Sep 2007 17:21:00 -0000 Message-ID: <20070911172124.19843.qmail@sourceware.org> X-Bugzilla-Reason: CC References: Subject: [Bug tree-optimization/33136] [4.1/4.2/4.3 Regression] wrong code due to alias with allocation in loop In-Reply-To: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "jakub at gcc dot gnu dot org" 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 X-SW-Source: 2007-09/txt/msg00953.txt.bz2 ------- Comment #27 from jakub at gcc dot gnu dot org 2007-09-11 17:21 ------- Created an attachment (id=14191) --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=14191&action=view) gcc43-pr33136.patch Updated patch which tries to handle SFTs as well. Unfortunately it causes a regression with gcc.dg/torture/pr26587.c at -O2 and above. That to me looks like an ipa-type-escape.c bug. In particular, may_alias_p is now called with a SFT whose type is ARRAY_TYPE. The first argument to ipa_type_escape_does_not_clobber_p is constant invariant 576> unit size constant invariant 72> align 32 symtab 0 alias set -1 canonical type 0x2aaaaea4f1a0 fields BLK size unit size align 32 symtab 0 alias set -1 canonical type 0x2aaaaea39ea0 domain pointer_to_this > BLK file pr26587.c line 8 size unit size align 32 offset_align 128 offset bit offset context > context pointer_to_this chain > and the second is unit size align 32 symtab 0 alias set -1 canonical type 0x2aaaae934680 precision 32 min max pointer_to_this > BLK size constant invariant 576> unit size constant invariant 72> align 32 symtab 0 alias set -1 canonical type 0x2aaaaea39ea0 domain unit size align 64 symtab 0 alias set -1 canonical type 0x2aaaae942270 precision 64 min max > public DI size unit size align 64 symtab 0 alias set -1 canonical type 0x2aaaaea39b60 precision 64 min max > pointer_to_this > ipa_type_escape_field_does_not_clobber_p calls get_canon_type_uid (, true, true) on this, which returns TYPE_UID of an unsigned int. But if I check what actually mark_interesting_addressof marked, it is TYPE_UID of a different ARRAY_TYPE - unit size align 32 symtab 0 alias set -1 canonical type 0x2aaaae934680 precision 32 min max pointer_to_this > BLK size constant invariant 576> unit size constant invariant 72> align 32 symtab 0 alias set 2 canonical type 0x2aaaaea39ea0 domain unit size align 64 symtab 0 alias set -1 canonical type 0x2aaaae942270 precision 64 min max > public DI size unit size align 64 symtab 0 alias set -1 canonical type 0x2aaaaea39b60 precision 64 min max >> so very different uid, and nothing actually ensures that if this type has been marked that e.g. what it sees through has been marked as well. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33136