From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 28205 invoked by alias); 6 Dec 2007 22:29:34 -0000 Received: (qmail 28189 invoked by uid 22791); 6 Dec 2007 22:29:33 -0000 X-Spam-Check-By: sourceware.org Received: from mail.codesourcery.com (HELO mail.codesourcery.com) (65.74.133.4) by sourceware.org (qpsmtpd/0.31) with ESMTP; Thu, 06 Dec 2007 22:29:28 +0000 Received: (qmail 11740 invoked from network); 6 Dec 2007 22:29:25 -0000 Received: from unknown (HELO localhost) (froydnj@127.0.0.2) by mail.codesourcery.com with ESMTPA; 6 Dec 2007 22:29:25 -0000 Date: Thu, 06 Dec 2007 22:29:00 -0000 From: Nathan Froyd To: gcc-patches@gcc.gnu.org Cc: zadeck@naturalbridge.com Subject: [lto] set alias info, poorly Message-ID: <20071206222919.GS14706@codesourcery.com> Mail-Followup-To: gcc-patches@gcc.gnu.org, zadeck@naturalbridge.com MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.13 (2006-08-11) X-IsSubscribed: yes Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org X-SW-Source: 2007-12/txt/msg00298.txt.bz2 First, the good news about this patch: it fixes a few failing testcases. The bad news is that it does it with a very heavy hammer. We say that every type can alias every other type. Obviously this wreaks havoc with all the clever alias analysis that has gone into GCC over the years. There are better, cleverer, more involved ways that you could fix this. But this demonstrably works right now. Ideas on what to do in the future welcome. Committed to the LTO branch. -Nathan 2007-12-06 Nathan Froyd * lto.c (lto_read_DIE): Set TYPE_ALIAS_SET where necessary. Index: lto.c =================================================================== --- lto.c (revision 130663) +++ lto.c (working copy) @@ -3253,7 +3253,13 @@ lto_read_DIE (lto_info_fd *fd, lto_conte /* If this DIE refers to a type, cache the value so that future references to the type can be processed quickly. */ if (val && TYPE_P (val)) - lto_cache_store_DIE (fd, die, val); + { + /* In the absence of a better solution, say that we alias + everything FIXME. */ + TYPE_ALIAS_SET (val) = 0; + + lto_cache_store_DIE (fd, die, val); + } context->skip_non_parameters = saved_skip_non_parameters; }