From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pf1-x434.google.com (mail-pf1-x434.google.com [IPv6:2607:f8b0:4864:20::434]) by sourceware.org (Postfix) with ESMTPS id 79B96385841E for ; Tue, 8 Feb 2022 17:47:21 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 79B96385841E Received: by mail-pf1-x434.google.com with SMTP id d187so20134655pfa.10 for ; Tue, 08 Feb 2022 09:47:21 -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=OuXfMQfWWUNJNT0VXQZw6+9+lQMkm0mtmnTOqJlV2zM=; b=tsSWVij0q2xr5xn62VehMHrk9bHGFNFCObuhRwFYjKeGyhCVkBi1j7muXjhzrgHt7Y 0A8A/A4wM12aUoSrKDgqIeaFsDndvUSIk6/XOHVULlOZLsxpqY39IrTKfCUb8TIlQJxR iPz1BRx9uggBCPUZ25Xv2RZmE6k79cMW6XQA/RBcU1WvejjShawG+jTnbMD9qBNWt7OJ VXP532F73gg4AcKgCZwzB5KN50Hrq/HJYoGNcJQJR+rOBDI3PY5v5WJhor2TLem5yeFK CWvnweUTRPnN6JdDdq1N4hboiEqXhOY70Bhw88pOcy8C44r0BtEJp5ICSpraDJJXUhAP kwGA== X-Gm-Message-State: AOAM530ZrY/l9Rkf8BPM7+GiUkkg6VsQBGFqPHFhbmIbalJVX6eEag7g TMGCcR55NxpvDljJ7SchAL6mtdMbEScuYR9rS0M= X-Google-Smtp-Source: ABdhPJxHhOEAHi2BrPssE5JAf/nyoKlb5qAQOi3s1x5nVuZPKDJBRgXJ10t+W2uCQYkF1VvOd1U1NL/fsCOsEY+gzZM= X-Received: by 2002:a05:6a00:2490:: with SMTP id c16mr5396901pfv.67.1644342440518; Tue, 08 Feb 2022 09:47:20 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: Krishna Narayanan Date: Tue, 8 Feb 2022 23:17:09 +0530 Message-ID: Subject: Re: Extended doubt regarding the bug 93432 To: Jonathan Wakely Cc: gcc-help X-Spam-Status: No, score=0.7 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM, HTML_MESSAGE, KAM_NUMSUBJECT, KAM_SHORT, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.29 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, 08 Feb 2022 17:47:23 -0000 Noted Sir,Thank you for the clarification. On Tue, Feb 8, 2022 at 11:07 PM Jonathan Wakely wrote: > > > On Tue, 8 Feb 2022 at 17:18, Krishna Narayanan < > krishnanarayanan132002@gmail.com> wrote: > >> Thanks for your response,Could you please clarify if this is a bug? >> > > It warns with -O1, which is the documented behaviour: > > The effectiveness of some warnings depends on optimizations also > being enabled. For example -Wsuggest-final-types is more > effective with link-time optimization and -Wmaybe-uninitialized does > not warn at all unless optimization is enabled. > > > So no, I don't think it' a bug. GCC is behaving as designed. Ideally it > would be better at warning without optimization, but changing that would be > hard. > > > > > >> Regards, >> Krishna Narayanan. >> >> On Tue, Feb 8, 2022 at 10:28 PM Jonathan Wakely >> wrote: >> >>> >>> >>> On Tue, 8 Feb 2022 at 16:25, Krishna Narayanan via Gcc-help < >>> gcc-help@gcc.gnu.org> wrote: >>> >>>> Hello, >>>> As an extension to the bug 93432 >>>> (https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93432), I would like to >>>> add a few more points,here in the given code >>>> (https://godbolt.org/z/sYjqjqh3d) there is a warning averted but there >>>> is no warning shown for this code >>>> (https://gcc.godbolt.org/z/oo5sf4oec) . >>>> I tried it with "-fno-strict-aliasing -fwrapv >>>> -fno-aggressive-loop-optimizations" and "fsanitize=undefined".There >>>> are no errors for gcc but clang has runtime errors,the error for >>>> clang: https://gcc.godbolt.org/z/1hq8x1o8E . >>>> >>>> Can we have a warning in the second case as well? It will be much more >>>> convenient as there is a lapse of initialization. >>>> >>> >>> Yes, ideally it would warn. >>> >>> >>> >>