From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-ed1-x536.google.com (mail-ed1-x536.google.com [IPv6:2a00:1450:4864:20::536]) by sourceware.org (Postfix) with ESMTPS id 1F46F3987423 for ; Fri, 4 Sep 2020 07:08:28 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 1F46F3987423 Received: by mail-ed1-x536.google.com with SMTP id l63so5075641edl.9 for ; Fri, 04 Sep 2020 00:08:28 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=hLEWJ/9B/oA0ffbQAVmdelOx4xMsuHtLjr3A13e9wyY=; b=M8qBWnyOMX9dz6CPf2uWfa4i0nxfAdwD3WXYq6mwhjVcd5PIJ3WcsMJqCjEMDMFEsO kBx6XafI0dXFxeQDqDXzdMJLfxKY0rliDOvY0w3FfC7cJ+Pa9o5O86tuNG6Cb53Wmfc4 fm5DDyxjTSzIHgvKUUsXtm+hvkFX6VepwVKPR2Szw8fdmpUTVqEGudluXjPc2tmVOF82 U0zow6fkHIYGxjtuyU3BPwKJ01a1jw131nWwG39D+EJYwzsGwzGLs/thOXd9ZvfxEEZM lTqHUA3LwX5BECQR6F9524jFs5cUbjSnuHvFROSUrI7Q9fCD7GTYP/70sTd6tL+Tb6yS 48Cg== X-Gm-Message-State: AOAM533FFjDuJWB+LJGKf9qBZHGAyaCcJXOd7dodc3nRNdJO0NR6G9Lp BCb/xZkR/w0r/aid/hJ7y1ix5TzPR94f89Y7Aj4= X-Google-Smtp-Source: ABdhPJyCiXata+eXhwECQKckIZBxyzqB11eb9S5hkfj+ubITf+4dszMKamysmRdLx5wrfIhyIlPafTJPgDfm4opVEg4= X-Received: by 2002:a50:d304:: with SMTP id g4mr6946260edh.248.1599203307026; Fri, 04 Sep 2020 00:08:27 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Richard Biener Date: Fri, 4 Sep 2020 09:08:16 +0200 Message-ID: Subject: Re: about souce code location To: =?UTF-8?B?5piT5Lya5oiY?= Cc: gcc Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-1.7 required=5.0 tests=BAYES_00, BODY_8BITS, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: gcc@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 04 Sep 2020 07:08:29 -0000 On Fri, Sep 4, 2020 at 2:23 AM =E6=98=93=E4=BC=9A=E6=88=98 via Gcc wrote: > > I am working a instrumention tool, and need get the location info for a g= imple statement. I use the location structure to get the info, and it can w= ork when i use -O1. When I use -O2, sometimes the info seems to be lost and= I get line num is zero.  anyone can tell me how to get the info? Not all statements have a location, if you encounter such you need to look at the "surrounding context" to find one.