From patchwork Sun Oct 31 21:34:14 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nathan Froyd X-Patchwork-Id: 69740 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) by ozlabs.org (Postfix) with SMTP id DE085B70E2 for ; Mon, 1 Nov 2010 08:34:27 +1100 (EST) Received: (qmail 28346 invoked by alias); 31 Oct 2010 21:34:26 -0000 Received: (qmail 28181 invoked by uid 22791); 31 Oct 2010 21:34:24 -0000 X-SWARE-Spam-Status: No, hits=-1.7 required=5.0 tests=AWL, BAYES_00, TW_BG, TW_ZJ, T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mail.codesourcery.com (HELO mail.codesourcery.com) (38.113.113.100) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Sun, 31 Oct 2010 21:34:19 +0000 Received: (qmail 2027 invoked from network); 31 Oct 2010 21:34:16 -0000 Received: from unknown (HELO codesourcery.com) (froydnj@127.0.0.2) by mail.codesourcery.com with ESMTPA; 31 Oct 2010 21:34:16 -0000 Date: Sun, 31 Oct 2010 17:34:14 -0400 From: Nathan Froyd To: Uros Bizjak Cc: gcc-patches@gcc.gnu.org, Diego Novillo Subject: Re: [PATCH] use build_vector_from_val in more places Message-ID: <20101031213413.GG6758@nightcrawler> References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.20 (2009-06-14) X-IsSubscribed: yes Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org On Sun, Oct 31, 2010 at 09:51:41AM +0100, Uros Bizjak wrote: > > The recently-introduced build_vector_from_val function can be used in > > several places, centralizing TREE_LIST use and making it easier to > > remove at a later point. The assertion change in build_vector_from_val > > is needed so as to not ICE while building libgfortran and is, I think, > > more correct in any event. > > This patch caused a regression on x86_64-pc-linux-gnu [1]: > > FAIL: gcc.dg/torture/pr45720.c -O2 -flto (internal compiler error) > FAIL: gcc.dg/torture/pr45720.c -O2 -flto (test for excess errors) > FAIL: gcc.dg/torture/pr45720.c -O2 -fwhopr (internal compiler error) > FAIL: gcc.dg/torture/pr45720.c -O2 -fwhopr (test for excess errors) > > You can trigger this ICE using following command sequence: > > $ /gcc/xgcc -B /gcc -O2 -flto -ftree-vectorize -c pr45720.c > $ /gcc/lto1 -O2 -ftree-vectorize -quiet pr45720.o Whoops! Apologies for the breakage. I think this is because there is no types_compatible_p hook for LTO, which makes sense. The below patch makes the assert use useless_type_conversion_p instead. Third time's the charm for such a simple assert... The patch fixes the above ICEs. Full testing in progress on x86_64-unknown-linux-gnu. OK to commit? -Nathan * tree.c (build_vector_from_val): Use useless_type_conversion_p. diff --git a/gcc/tree.c b/gcc/tree.c index 4de73ee..a746031 100644 --- a/gcc/tree.c +++ b/gcc/tree.c @@ -1376,8 +1376,8 @@ build_vector_from_val (tree vectype, tree sc) if (sc == error_mark_node) return sc; - gcc_assert (lang_hooks.types_compatible_p (TREE_TYPE (sc), - TREE_TYPE (vectype))); + gcc_assert (useless_type_conversion_p (TREE_TYPE (sc), + TREE_TYPE (vectype))); v = VEC_alloc (constructor_elt, gc, nunits); for (i = 0; i < nunits; ++i)