From patchwork Wed Jul 3 00:24:58 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dehao Chen X-Patchwork-Id: 256524 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]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "localhost", Issuer "www.qmailtoaster.com" (not verified)) by ozlabs.org (Postfix) with ESMTPS id 5119A2C00A4 for ; Wed, 3 Jul 2013 10:25:13 +1000 (EST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :mime-version:date:message-id:subject:from:to:cc:content-type; q=dns; s=default; b=nykLzLEo/61PEcwNvz9oTzNkrXVnP49iejkZ0+oTiu1 zLyg/Q62pRIrbNavWtNAaPHAq4+GoQi/MMnDQBUlI8TfuHY4Mh876Fy/SvCgvFC3 PFxnEG/xVLkkdE+AC+6peccZGUA0SlnHNCNDdEt5A8OTcQsJSE9RSW5MfyWMBLwU = DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :mime-version:date:message-id:subject:from:to:cc:content-type; s=default; bh=6TH5cB/f+p+YLoB4EExlHbje76I=; b=RS9Asi4x/He5gI3lI knapMJcUFHCVMbejb15dArz7tigIW8TrlIR2eqEpdJBkSSw1XnL5S/u+rc0mo2E2 xU/zy9bwXY/lHjkY0LkfTzhTGBv/z69c2qa9DXpDOHAIMGwDXBN6+tJ6yOF3r+Ce 6bSMgHdC+3bNpSNOI7zxJP0wVQ= Received: (qmail 15690 invoked by alias); 3 Jul 2013 00:25:07 -0000 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 Received: (qmail 15641 invoked by uid 89); 3 Jul 2013 00:25:01 -0000 X-Spam-SWARE-Status: No, score=-3.3 required=5.0 tests=AWL, BAYES_00, RCVD_IN_DNSWL_LOW, RCVD_IN_HOSTKARMA_YE, RP_MATCHES_RCVD, SPF_PASS, TW_TM autolearn=ham version=3.3.1 Received: from mail-ea0-f169.google.com (HELO mail-ea0-f169.google.com) (209.85.215.169) by sourceware.org (qpsmtpd/0.84/v0.84-167-ge50287c) with ESMTP; Wed, 03 Jul 2013 00:25:00 +0000 Received: by mail-ea0-f169.google.com with SMTP id h15so3078415eak.14 for ; Tue, 02 Jul 2013 17:24:58 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:date:message-id:subject:from:to:cc:content-type :x-gm-message-state; bh=GZFAMYfo5j8apdgQc0udVHbBaVxTvPBkLKRfaoG9rg8=; b=RX6tdGxQJn+kY116RaLJV2PxAcSRGEv1ZqstozqCA0C70Qc8z7pn/E9rwpYG6wgST6 cjU+WAIbdmeKuGjQItV0LrIR2Pu94GSbzjAeMsqjfbQNS6V2dWZX4P0E9FSchwnQwqzB +mva0zXedlU/S5RR2O2FjbsLPokRG/mzVjLB5dWZ/AS1xkGJUn62WiLFGEcsNKpNHh9P TceFhxPSBKxZA3gMbBQn7mhYW7X6Sg+actPXaMOSxncukL2pgrU7eGZTsJgD0cER7fgB VUGjSmERGcPMAEmHGNtl1Ba7Pqu3Rc467hghDzJyuR0U8lCsmCK4IIShbBs3bQP/uPyP UWIw== MIME-Version: 1.0 X-Received: by 10.15.94.142 with SMTP id bb14mr28575253eeb.112.1372811098175; Tue, 02 Jul 2013 17:24:58 -0700 (PDT) Received: by 10.14.210.69 with HTTP; Tue, 2 Jul 2013 17:24:58 -0700 (PDT) Date: Tue, 2 Jul 2013 17:24:58 -0700 Message-ID: Subject: [Google] Fix discriminator assignment for stmts From: Dehao Chen To: GCC Patches Cc: Cary Coutant X-Gm-Message-State: ALoCoQkDNY+jDyliV8L+QO4ZfuIDAyuo+QmuJjuDoOXY87VH8X5keadUNYly/b4+4sPhh6Eh7d0DxWWRkzicGVzafjIKpI7Q4c7QrpierUSsxRHVrresoDqnKtkEmJfq1orGCqLybREfpMC6FSWQcqOFQxJWqEyJ61gLszP9Y5zBl2+8YoQasHD+KprlVa0JKqfUlgkr31S/fqnqbpLlC1B47fBDH3hWJQ== This patch fixes the discriminator assignments for stmts. It used to apply a signle locus for everything, which is not right (will invalidate locus for macro expansion). Bootstrapped and passed regression test. OK for google-4_8? Thanks, Dehao Index: gcc/input.c =================================================================== --- gcc/input.c (revision 200625) +++ gcc/input.c (working copy) @@ -308,7 +308,7 @@ location_with_discriminator (location_t locus, int { tree block = LOCATION_BLOCK (locus); location_t ret; - locus = LOCATION_LOCUS (locus); + locus = map_discriminator_location (locus); if (locus == UNKNOWN_LOCATION) return block ? COMBINE_LOCATION_DATA (line_table, locus, block) Index: gcc/tree-cfg.c =================================================================== --- gcc/tree-cfg.c (revision 200625) +++ gcc/tree-cfg.c (working copy) @@ -751,24 +751,22 @@ static void assign_discriminator (location_t locus, basic_block bb) { gimple_stmt_iterator gsi; - tree block = LOCATION_BLOCK (locus); + int discriminator; locus = map_discriminator_location (locus); if (locus == UNKNOWN_LOCATION) return; - locus = location_with_discriminator ( - locus, next_discriminator_for_locus (locus)); + discriminator = next_discriminator_for_locus (locus); - if (block != NULL) - locus = COMBINE_LOCATION_DATA (line_table, locus, block); - for (gsi = gsi_start_bb (bb); !gsi_end_p (gsi); gsi_next (&gsi)) { gimple stmt = gsi_stmt (gsi); - if (same_line_p (locus, gimple_location (stmt))) - gimple_set_location (stmt, locus); + location_t stmt_locus = gimple_location (stmt); + if (same_line_p (locus, stmt_locus)) + gimple_set_location ( + stmt, location_with_discriminator (stmt_locus, discriminator)); } }