From patchwork Wed Jul 7 15:10:34 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Duncan Sands X-Patchwork-Id: 58123 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 EA945B6F0C for ; Thu, 8 Jul 2010 01:10:56 +1000 (EST) Received: (qmail 19574 invoked by alias); 7 Jul 2010 15:10:53 -0000 Received: (qmail 19564 invoked by uid 22791); 7 Jul 2010 15:10:51 -0000 X-SWARE-Spam-Status: No, hits=-2.6 required=5.0 tests=AWL, BAYES_00, FREEMAIL_FROM X-Spam-Check-By: sourceware.org Received: from matups.math.u-psud.fr (HELO matups.math.u-psud.fr) (129.175.50.4) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 07 Jul 2010 15:10:45 +0000 Received: from barah.math.u-psud.fr (barah.math.u-psud.fr [129.175.52.24]) by matups.math.u-psud.fr (Postfix) with ESMTP id D8FAD7973 for ; Wed, 7 Jul 2010 17:10:42 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by barah.math.u-psud.fr (Postfix) with ESMTP id D3C1247411C for ; Wed, 7 Jul 2010 17:10:42 +0200 (CEST) Received: from barah.math.u-psud.fr ([127.0.0.1]) by localhost (barah.math.u-psud.fr [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id YZI80OxBX7HD for ; Wed, 7 Jul 2010 17:10:40 +0200 (CEST) Received: from [IPv6:::1] (topodyn-ng.math.u-psud.fr [129.175.50.33]) by barah.math.u-psud.fr (Postfix) with ESMTP id 3F559474117 for ; Wed, 7 Jul 2010 17:10:39 +0200 (CEST) Message-ID: <4C3498EA.1090803@free.fr> Date: Wed, 07 Jul 2010 17:10:34 +0200 From: Duncan Sands User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.10) Gecko/20100702 Thunderbird/3.0.5 MIME-Version: 1.0 To: gcc-patches Subject: Fix pr middle-end/41355 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 When materializing a cloned function with arguments removed, to TYPE_POINTER_TO field of the new type (which has fewer arguments) was left pointing to the original type. Bootstraps and passes regression testing (tested on the 4.5 branch since 4.6 seems ill right now). Jan Hubicka says "it seems fine to me, but I can not approve it". OK to apply to mainline and 4.5? Changelog entry: 2010-07-07 Duncan Sands PR middle-end/41355 * tree.c (build_function_type_skip_args): Copy the original type using build_distinct_type_copy rather than copy_node. Index: tree.c =================================================================== --- tree.c (revision 161914) +++ tree.c (working copy) @@ -7350,7 +7350,7 @@ if (TREE_CODE (orig_type) != METHOD_TYPE || !bitmap_bit_p (args_to_skip, 0)) { - new_type = copy_node (orig_type); + new_type = build_distinct_type_copy (orig_type); TYPE_ARG_TYPES (new_type) = new_reversed; } else