From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-ed1-x529.google.com (mail-ed1-x529.google.com [IPv6:2a00:1450:4864:20::529]) by sourceware.org (Postfix) with ESMTPS id 928B43858C2C for ; Tue, 21 Dec 2021 16:05:56 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 928B43858C2C Received: by mail-ed1-x529.google.com with SMTP id j6so33159749edw.12 for ; Tue, 21 Dec 2021 08:05:56 -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=i9YEyLmrr5Wfr3yqOL5vlm9y+d7DUK07N5PnME+OytI=; b=tVPhRV6eM4Z0w1iYgEC/N+cB8iKNdqamARWZB5keh7wSFiyrM+CtoUrVL/MUH+k4sD sfpSNTzQqFfzXk4SGyEGyMxRiRMBJoXuhG5OfwuIC5HILG4YF7iAsbaYYq9AUTQrg9Bg y/jR07TMaBBtAJ8WUz7QtXHM2+sInHhgXWztTHTvuTd4mWmmr61Yuk7TwZ+scQE2SCme rl6fvDjxlswiQYPu7Z4Rop4578BUV5IHNDSfZ4lvVwmlbua2dtTgxQIq6stMfgS1qLCA X9C84rHfp/ovBb0P5332DdZ94rleUtYjEFTw3tIa+Xl0NCT4jsB5zrDj3Ut3wMMxhOXT JZ9g== X-Gm-Message-State: AOAM530FQZBdhd10GoEyIl1iM98LMu7uGbEfb/d77SRp9xTgjtd4rlRb 1SHqTFI4Ef7Ju9cY3vjUPu3IzofEOtZw6Nrvzxk= X-Google-Smtp-Source: ABdhPJy9eomiIIdoHfDByD0bs32FeMF13cgKeLS3EeUxWYGT82V8wNjOP5Xuin58xik7vR+9ZYrppcsXIw5lHpXI/Mo= X-Received: by 2002:a05:6402:270c:: with SMTP id y12mr3921795edd.258.1640102755540; Tue, 21 Dec 2021 08:05:55 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: Stefan Ring Date: Tue, 21 Dec 2021 17:05:44 +0100 Message-ID: Subject: Re: broken code only when optimized "-O2" To: Adrian Moreno Cc: gcc-help Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-0.9 required=5.0 tests=BAYES_00, 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.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, 21 Dec 2021 16:05:57 -0000 On Tue, Dec 21, 2021 at 4:40 PM Adrian Moreno via Gcc-help wrote: > > I'd really appreciate any hint or idea to try to understand this problem. I guess the compiler doesn't like the dereferencing of uninitialized pointers (in the sizeof expressions). I am not 100% sure that this counts as dereferencing, but I would assume so. Because of this the compiler will be free to behave however it likes to.