From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pf1-x429.google.com (mail-pf1-x429.google.com [IPv6:2607:f8b0:4864:20::429]) by sourceware.org (Postfix) with ESMTPS id B0E0E3858027 for ; Tue, 22 Feb 2022 18:30:59 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org B0E0E3858027 Received: by mail-pf1-x429.google.com with SMTP id p8so12924795pfh.8 for ; Tue, 22 Feb 2022 10:30:59 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=OXKFKeysmQ8svnKUKtU5Zk6AkvaUXoGFqXw7t1g4K6c=; b=XWKzQ9xxcf8as5R4YrgHxxazKiTYjM7AuoryROeoE2hLOgXVdMJ41WpyGsoZHxkRQh YdJtww2oy8CXI5/YRjehCb7t+ejDWGVaVhBP9LEDkPY9XjBV7ElKhD123MWoE2pncjkU kp1YhJ38vOaxu3rP9skqNnuFYZAhHncJe2AoAKpB4YjyWOJHPiIaMYTSR26gLyWzgTbQ ohS1YrEYRw7T5v1hZhsXwTkpwEfweqUoFhKiz9/N7XSV/RAeGMpdCoGoKR72mbxiaCvQ o1/wR2S1fwEhW+P2mXQ4Z4ZlQ9FjHK0oBqoKxCe+2w3zqnAQYMDB3YwhV66H24SUZ26/ 6p9w== X-Gm-Message-State: AOAM530PjKKF8Bo7rLqw6vSVoVipDmX6BFcF7X3cA2Pc3WPhvS4AToxa yMT7Owv82MFZpFaPOCY6ricU4zxNGfxdGuso6H8= X-Google-Smtp-Source: ABdhPJyydq7OgnU+Gk25ucUcIB7kiixwEQz2SlbRZCP5+7bcigXSSYUlDpdv6uXcQ9zz9tbFP17HY+re3Lve5atRmvg= X-Received: by 2002:a63:6581:0:b0:34d:501a:415d with SMTP id z123-20020a636581000000b0034d501a415dmr20858882pgb.341.1645554658784; Tue, 22 Feb 2022 10:30:58 -0800 (PST) MIME-Version: 1.0 References: <20220222154432.GV614@gate.crashing.org> In-Reply-To: <20220222154432.GV614@gate.crashing.org> From: Krishna Narayanan Date: Wed, 23 Feb 2022 00:00:47 +0530 Message-ID: Subject: Re: Doubt regarding dg-directives To: Segher Boessenkool Cc: Jonathan Wakely , gcc-help Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=0.1 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: gcc-help@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-help mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Feb 2022 18:31:01 -0000 On Tue, Feb 22, 2022 at 9:16 PM Segher Boessenkool wrote: > > On Tue, Feb 22, 2022 at 09:08:40PM +0530, Krishna Narayanan via Gcc-help wrote: > > Yes, it does. > > I used dg-warning and not dg warning (that was a sheer typing mistake). > > The warning is about the uninitialized variable being used in the > > testcase yet there is no warning on that line and the test results in > > FAIL. > > I used /* { dg-warning "uninitialized" } */ on that particular line.I > > used the test in gcc.dg, with other directive /* { dg-options "-O2" } > > */ . > > Can you help me where I went wrong? > > Please send the verbatim testcase (and don't top-post please). Guessing > is a fun game sometimes, but more often it is just frustrating. /* { dg-do compile } */ /* { dg-options "-O2" } */ int test(int y) { int z; int x; int a; for (x = 0; x < 10; x = x + 1, y = y + 1,a = a + 1) { if (y < 10) { z = z + 1 + a; /* { dg-warning "uninitialized" } */ } } return z; } Here is the test case,I apologize for the inconvenience caused earlier due to indirect context. Thanks, Krishna Narayanan.