From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8870 invoked by alias); 1 Nov 2012 14:36:01 -0000 Received: (qmail 8685 invoked by uid 22791); 1 Nov 2012 14:35:59 -0000 X-SWARE-Spam-Status: No, hits=-6.2 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 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; Thu, 01 Nov 2012 14:35:55 +0000 Received: by mail-pa0-f47.google.com with SMTP id fa11so1704008pad.20 for ; Thu, 01 Nov 2012 07:35:54 -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=skOGfANWA2sjGfjKXPdFn1mD/h7dZ607VKpNoBY1nKA=; b=HUlDVYLTRyx/njNsfHJJSy5XeOK2ingjIjSkxS8I1F+9H+Meo+f/wOfv7/YJG8VrEU wpw6cbZMjENxdB4HiWNqKQEbWKouTXhZZUHpDhd5TltQvIltl/UlT37cPq+2mgKtgmiP A2vki/uDh8rzU1mje6s7GJJvGMRBBt9i73sh7Vc2AI3XdN9h57HDkxzX7fjN5K+Zmhg0 w+nIRTtZ5bkk9XMnwoKei6F95IoCnGoE9h5RJlfXDIvtaum2V/uLUG5nWux6WEQem8Eq 4wFLJmfeaKml+omQmJANZDrhMD4DmFbOmj8qrxWcnkDCRsqW6N9f1XAS04de/lfleruJ BxWA== MIME-Version: 1.0 Received: by 10.68.224.69 with SMTP id ra5mr122456101pbc.114.1351780554546; Thu, 01 Nov 2012 07:35:54 -0700 (PDT) Received: by 10.68.49.232 with HTTP; Thu, 1 Nov 2012 07:35:54 -0700 (PDT) In-Reply-To: <1826073.rNRXULK6yo@polaris> References: <1826073.rNRXULK6yo@polaris> Date: Thu, 01 Nov 2012 14:36:00 -0000 Message-ID: Subject: Re: [PATCH] Reset source location for instructions moved out of its original residing basic block From: Dehao Chen To: Eric Botcazou Cc: GCC Patches Content-Type: text/plain; charset=ISO-8859-1 X-System-Of-Record: true X-Gm-Message-State: ALoCoQnJ0mZ/5+BGcgu3PUuL3BEyaSaaG9XVG2gueks7g/rilrwrk7buOilpax2NuAoXC9FyoyPkPaI6CnQG0itd1PC5IEFtEPF/U37cya21GeX7xMczWfy29nxKONBeXZ101A5LXM4PlL6Hj2XlkXxeVJ1eeLcln+RuDcR63FvR8GBsJmDeKXHZ1/ZBxyrQRKvCjkLVpTa9 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: 2012-11/txt/msg00049.txt.bz2 On Thu, Nov 1, 2012 at 1:52 AM, Eric Botcazou wrote: >> This patch tries to fix this problem by resetting the source location >> when moving instructions to another BB. This can greatly improve the >> debuggability of optimized code. For the attached unittest. Without >> the patch, the debugger will always jump into line 14 even when the >> branch at line 13 is not taken. With the patch, the problem is fixed. > > But this breaks coverage info! You cannot change the source location of For optimized code, there are many optimizations that can break coverage info. Code motion is one of them. This patch actually tries to fix the broken coverage info, as illustrated by the unittest. > instructions randomly like that; the rule should be that, once a location is > set, it cannot be changed. At most it can be cleared. If we clear the debug info for instructions moved to other BB, is it acceptable? Thanks, Dehao > >> gcc/ChangeLog: >> 2012-10-31 Dehao Chen >> >> * emit-rtl.c (reorder_insns): Reset the source location for >> instructions moved out of its original residing basic block. > > No, that isn't acceptable. > > -- > Eric Botcazou