From patchwork Mon Oct 29 20:40:35 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dehao Chen X-Patchwork-Id: 195136 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 A690C2C009B for ; Tue, 30 Oct 2012 07:40:50 +1100 (EST) Comment: DKIM? See http://www.dkim.org DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=gcc.gnu.org; s=default; x=1352148050; h=Comment: DomainKey-Signature:Received:Received:Received:Received: MIME-Version:Received:Received:In-Reply-To:References:Date: Message-ID:Subject:From:To:Cc:Content-Type:Mailing-List: Precedence:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:Sender:Delivered-To; bh=4cUEeQLPA/sDSCABocDf6LhfGX4=; b=sYm2KFbSFwh931hzFJsBu2gjawlQviGW1cLUq1b9L/bcmOTNkGOQpm/1CfAS5K tP33rzzusEplKYlrW+qBb/m8BIGeW/egYamJQpIo/4dVPjS7Niq8eK5+qfNve8UG YALLWQLAhZKw83mdiJUrrxgXxe4kd/hnF2N0soLdUO9YM= Comment: DomainKeys? See http://antispam.yahoo.com/domainkeys DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=default; d=gcc.gnu.org; h=Received:Received:X-SWARE-Spam-Status:X-Spam-Check-By:Received:Received:X-Google-DKIM-Signature:MIME-Version:Received:Received:In-Reply-To:References:Date:Message-ID:Subject:From:To:Cc:Content-Type:X-System-Of-Record:X-Gm-Message-State:X-IsSubscribed:Mailing-List:Precedence:List-Id:List-Unsubscribe:List-Archive:List-Post:List-Help:Sender:Delivered-To; b=qlMxAJdobpSJOorJ5RUp+k32auWhWo8kk4y38xSKZgVELPJsSlKWAdfSbhFkGK Mkm/iw2F0+FdfV3uP7CKv0DM/FIQnH2XauSJIDRfohK7DQNk0tU3JCkruikW9Ol5 t8xbSllplnZG0uoA1Ev+DNGipYn3FJh7ZPIh6LvIsWPc4=; Received: (qmail 21648 invoked by alias); 29 Oct 2012 20:40:44 -0000 Received: (qmail 21559 invoked by uid 22791); 29 Oct 2012 20:40:43 -0000 X-SWARE-Spam-Status: No, hits=-6.1 required=5.0 tests=AWL, BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, KHOP_RCVD_TRUST, KHOP_THREADED, RCVD_IN_DNSWL_LOW, RCVD_IN_HOSTKARMA_YE, RP_MATCHES_RCVD, TW_TM X-Spam-Check-By: sourceware.org Received: from mail-pa0-f47.google.com (HELO mail-pa0-f47.google.com) (209.85.220.47) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 29 Oct 2012 20:40:36 +0000 Received: by mail-pa0-f47.google.com with SMTP id fa11so3461501pad.20 for ; Mon, 29 Oct 2012 13:40:35 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:x-system-of-record:x-gm-message-state; bh=hU2m9G9nH59QTNMJVJoyrvcTx+FPLiy8e32gbcKaAnE=; b=Okx7ic4J4U2cu96E3sxKpBbNrkx3biIZeerE2LrybxJARBi7WuGi5W0TP3o4mr9e6K pXfP0eTY834aWve3b6kXLJnQGSOAZJZAbkf5qaED9AAkSKadg8DqAKoVCdk8WpEkax0M f0gZNS4BGlgZtkxO+QBSXSuDzPB9NJUHZScXwTy1YMEKn8UtrFymhLFQw8TtBuU64JNV RVOcFdp4IfYh/GigEnNb036ItcqP6qqaf+qe61miM7HMO0sn5A4cyKiU4WsdCSx2dogB lUE2484hyPo8pVF3wulldLR3wFSrbl/XRAbI56FQHYOGzFvDG2d66W1rbVBtWakwSlpD +i6Q== MIME-Version: 1.0 Received: by 10.66.80.65 with SMTP id p1mr86222507pax.20.1351543235633; Mon, 29 Oct 2012 13:40:35 -0700 (PDT) Received: by 10.68.49.232 with HTTP; Mon, 29 Oct 2012 13:40:35 -0700 (PDT) In-Reply-To: References: <1945668.Pu87KJAiWx@polaris> Date: Mon, 29 Oct 2012 13:40:35 -0700 Message-ID: Subject: Re: [PATCH] Fix debug info for expr and jump stmt From: Dehao Chen To: Richard Biener Cc: Michael Matz , Eric Botcazou , GCC Patches , Jason Merrill X-System-Of-Record: true X-Gm-Message-State: ALoCoQnsXMOXxSHMSnkXj090MSCetUydxttC/CbKefmPYLGQQRiir97hF97bPvtuYEDHohm0BXA6AGcorunxO1bMYuLYRPFr/9Gy3N13PNCv2ZVXg5D9Q1+ESLwX8aV7Y81/gji8wDOoe/L8RW3b999KKwtMhvtQMB+bePEmfQAIY4fmos0iGqalLP3hk7eA3cBkmfRNPIqb 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 Hi, Attached is the new patch. This patch bootstrapped and passed all tests except the following: FAIL: gcc.dg/guality/pr43479.c -O1 line 13 h == 9 FAIL: gcc.dg/guality/pr43479.c -O1 line 18 h == 9 FAIL: gcc.dg/guality/pr43479.c -O2 line 13 h == 9 FAIL: gcc.dg/guality/pr43479.c -O2 line 18 h == 9 FAIL: gcc.dg/guality/pr43479.c -O3 -fomit-frame-pointer line 13 h == 9 FAIL: gcc.dg/guality/pr43479.c -O3 -fomit-frame-pointer line 18 h == 9 FAIL: gcc.dg/guality/pr43479.c -O3 -g line 13 h == 9 FAIL: gcc.dg/guality/pr43479.c -O3 -g line 18 h == 9 FAIL: gcc.dg/guality/pr43479.c -Os line 13 h == 9 FAIL: gcc.dg/guality/pr43479.c -Os line 18 h == 9 FAIL: gcc.dg/guality/pr43479.c -O2 -flto -fno-use-linker-plugin -flto-partition=none line 13 h == 9 FAIL: gcc.dg/guality/pr43479.c -O2 -flto -fno-use-linker-plugin -flto-partition=none line 18 h == 9 FAIL: gcc.dg/guality/pr43479.c -O2 -flto -fuse-linker-plugin -fno-fat-lto-objects line 13 h == 9 FAIL: gcc.dg/guality/pr43479.c -O2 -flto -fuse-linker-plugin -fno-fat-lto-objects line 18 h == 9 But looks like they are all non-O0 related debugging issues. Is it acceptable? Thanks, Dehao gcc/ChangeLog: 2012-10-25 Dehao Chen * tree-eh.c (do_return_redirection): Set location for jump statement. (do_goto_redirection): Likewise. (frob_into_branch_around): Likewise. (lower_try_finally_nofallthru): Likewise. (lower_try_finally_copy): Likewise. (lower_try_finally_switch): Likewise. * expr.c (store_expr): Use current insn location instead of expr location. (expand_expr_real): Likewise. (expand_expr_real_1): Likewise. gcc/testsuite/ChangeLog: 2012-10-25 Dehao Chen * g++.dg/debug/dwarf2/block.C: New testcase. Index: gcc/expr.c =================================================================== --- gcc/expr.c (revision 192809) +++ gcc/expr.c (working copy) @@ -5030,7 +5030,7 @@ store_expr (tree exp, rtx target, int call_param_p { rtx temp; rtx alt_rtl = NULL_RTX; - location_t loc = EXPR_LOCATION (exp); + location_t loc = curr_insn_location (); if (VOID_TYPE_P (TREE_TYPE (exp))) { @@ -7881,8 +7881,7 @@ expand_expr_real (tree exp, rtx target, enum machi { location_t saved_location = input_location; location_t saved_curr_loc = curr_insn_location (); - input_location = EXPR_LOCATION (exp); - set_curr_insn_location (input_location); + input_location = curr_insn_location (); ret = expand_expr_real_1 (exp, target, tmode, modifier, alt_rtl); @@ -9481,7 +9480,7 @@ expand_expr_real_1 (tree exp, rtx target, enum mac with non-BLKmode values. */ gcc_assert (GET_MODE (ret) != BLKmode); - val = build_decl (EXPR_LOCATION (exp), + val = build_decl (curr_insn_location (), VAR_DECL, NULL, TREE_TYPE (exp)); DECL_ARTIFICIAL (val) = 1; DECL_IGNORED_P (val) = 1; Index: gcc/ChangeLog =================================================================== --- gcc/ChangeLog (revision 192809) +++ gcc/ChangeLog (working copy) @@ -1,3 +1,14 @@ +2012-10-25 Dehao Chen + + * tree-eh.c (do_return_redirection): Set location for jump statement. + (do_goto_redirection): Likewise. + (frob_into_branch_around): Likewise. + (lower_try_finally_nofallthru): Likewise. + (lower_try_finally_copy): Likewise. + (lower_try_finally_switch): Likewise. + * gimple-low.c (tree_set_block_r): New callback function. + (lower_stmt): Set block for tested expr. + 2012-10-25 Jan Hubicka PR tree-optimize/54980 Index: gcc/testsuite/ChangeLog =================================================================== --- gcc/testsuite/ChangeLog (revision 192809) +++ gcc/testsuite/ChangeLog (working copy) @@ -1,3 +1,7 @@ +2012-10-25 Dehao Chen + + * g++.dg/debug/dwarf2/block.C: New testcase. + 2012-10-25 Marc Glisse PR c++/54427 Index: gcc/testsuite/g++.dg/debug/dwarf2/block.C =================================================================== --- gcc/testsuite/g++.dg/debug/dwarf2/block.C (revision 0) +++ gcc/testsuite/g++.dg/debug/dwarf2/block.C (revision 0) @@ -0,0 +1,29 @@ +// Compiler should not generate too many lexical blocks for this function. +// { dg-do compile { target { i?86-*-* x86_64-*-* } } } +// { dg-options "-O0 -fno-exceptions -g -dA" } + +union UElement { + void* pointer; + int integer; +}; +struct UColToken { + unsigned source; + unsigned char **rulesToParseHdl; +}; + +int uhash_hashTokens(const union UElement k) +{ + int hash = 0; + struct UColToken *key = (struct UColToken *)k.pointer; + if (key != 0) { + int len = (key->source & 0xFF000000)>>24; + int inc = ((len - 32) / 32) + 1; + const unsigned char *p = (key->source & 0x00FFFFFF) + + *(key->rulesToParseHdl); + const unsigned char *limit = p + len; + hash = *p + *limit; + } + return hash; +} + +// { dg-final { scan-assembler-not "LBB10" } } Index: gcc/tree-eh.c =================================================================== --- gcc/tree-eh.c (revision 192809) +++ gcc/tree-eh.c (working copy) @@ -739,6 +739,7 @@ do_return_redirection (struct goto_queue_node *q, gimple_seq_add_seq (&q->repl_stmt, mod); x = gimple_build_goto (finlab); + gimple_set_location (x, q->location); gimple_seq_add_stmt (&q->repl_stmt, x); } @@ -758,6 +759,7 @@ do_goto_redirection (struct goto_queue_node *q, tr gimple_seq_add_seq (&q->repl_stmt, mod); x = gimple_build_goto (finlab); + gimple_set_location (x, q->location); gimple_seq_add_stmt (&q->repl_stmt, x); } @@ -857,6 +859,7 @@ frob_into_branch_around (gimple tp, eh_region regi if (!over) over = create_artificial_label (loc); x = gimple_build_goto (over); + gimple_set_location (x, loc); gimple_seq_add_stmt (&cleanup, x); } gimple_seq_add_seq (&eh_seq, cleanup); @@ -1085,6 +1088,7 @@ lower_try_finally_nofallthru (struct leh_state *st emit_post_landing_pad (&eh_seq, tf->region); x = gimple_build_goto (lab); + gimple_set_location (x, gimple_location (tf->try_finally_expr)); gimple_seq_add_stmt (&eh_seq, x); } } @@ -1223,6 +1227,7 @@ lower_try_finally_copy (struct leh_state *state, s tmp = lower_try_finally_fallthru_label (tf); x = gimple_build_goto (tmp); + gimple_set_location (x, tf_loc); gimple_seq_add_stmt (&new_stmt, x); } @@ -1395,6 +1400,7 @@ lower_try_finally_switch (struct leh_state *state, tmp = lower_try_finally_fallthru_label (tf); x = gimple_build_goto (tmp); + gimple_set_location (x, tf_loc); gimple_seq_add_stmt (&switch_body, x); } @@ -1423,6 +1429,7 @@ lower_try_finally_switch (struct leh_state *state, gimple_seq_add_stmt (&eh_seq, x); x = gimple_build_goto (finally_label); + gimple_set_location (x, tf_loc); gimple_seq_add_stmt (&eh_seq, x); tmp = build_int_cst (integer_type_node, eh_index);