From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-oo1-xc2f.google.com (mail-oo1-xc2f.google.com [IPv6:2607:f8b0:4864:20::c2f]) by sourceware.org (Postfix) with ESMTPS id 2CB3A3858D33 for ; Sun, 19 Nov 2023 15:13:49 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 2CB3A3858D33 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 2CB3A3858D33 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2607:f8b0:4864:20::c2f ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1700406830; cv=none; b=wdu/DcVeu6Jkpknip/K64T2Y9/ZxENfTdlu31P+/FHEJnnq5uTh04q9JZXDRZHJScd2kCtboy2xGNv40feVy1yTzXO0O5sCNCrugpQLVNwUyLWWghNpQOCpqpUIvOh49qFCg8dB6/zp/7SQOYfeitafENi9IBabyFchYw/9xk0s= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1700406830; c=relaxed/simple; bh=LboE43d1F/Z07vhwr2sP8VWOARbsaFWf3n1abPrVwF8=; h=DKIM-Signature:Message-ID:Date:MIME-Version:Subject:To:From; b=i+BRy3K7DbgdMrDgU+y48oNc7wL24z44R11XRMgAmFtcmXG/tOsRECcQhlzJaqXPai7wu96uJm4g0T59KiSVCvyr16jSVT0G9Hbf6gsoUrH5CixobnD1JzboAZqphbgN7BpvDkHSEFTd6RFRsePW9UvvLAii3PQeTWJQzHcIJkU= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-oo1-xc2f.google.com with SMTP id 006d021491bc7-58786e23d38so2265470eaf.3 for ; Sun, 19 Nov 2023 07:13:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1700406828; x=1701011628; darn=gcc.gnu.org; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=R2dm1s32fKgNAW5RFy97DSN6hOkGB+F+c4r1qrAd20Q=; b=nEzFQzSagg1ehH8aSa+mvA5Hd/p88Edpv7c+3UUyztMI33UVKPFJ50DD96dH8lbJs0 BfpvZ04iK+pWTkChhrDxLf2Mu2AQHAGwobEFKm1MV8j3T3izO2Zb8vYBla2eJMgFBm+D 1zkaFt3T18diTOOV2b1rIDIm3NARO0WIfo+U2a/OdJYaLRfC6gZ25JMc4UKOmmG+tCV1 xVxIL2bNGyWDKxF98Ue6lI5vww9rJJdQdq2rEvwPWPcQdYTuw8MXZGkk4ifmVnxOBbXV 48HZpL/zG4iW6UI+Vkn2T3NmBITkf2Mzw8vwoc2E6vg5bWbcnLqLqa4i0C1a/zo20opg 2mpQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1700406828; x=1701011628; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=R2dm1s32fKgNAW5RFy97DSN6hOkGB+F+c4r1qrAd20Q=; b=tOjSV2B3l7pGTU3AYoExffH26oJELC3IBW6Y5am3Fx9Lsu4Gs1a61KOEYduZq5Cx/e 8/H8520PEgUzCihhF2XR2/79RI2Inx67keuLz2i84V5YHt/ao0qDsv7D/CA/3859u24h O2PvGuJecy1kkthHPXdPTs25uqtzmIuN5nXXghhSCy6J250jU/BxjTC49VwcsSoKKKIY hwpAJG6fq9EaxBPI3RNZRiSwe88weCDjUQezlygEbLFiKNtRDDIIFCBSGKA+af8LYLHn 0Pe9GnqXIWk9t/RM5M51tUWIC6e4PzMdQxfCmTOpqXIEgMJ9/9FKZ4Zn+guZjayhDtq3 /AIQ== X-Gm-Message-State: AOJu0YyMT+1oEMCcKAvuGyqY5ZO2rk1Q3cd6DBTTnbq/izbeLThuZAzk Mu+xQ53h4fqoJ1Q9g28OIfxfHLkRf0BtVQ== X-Google-Smtp-Source: AGHT+IFq/fucVK2kGKPw9p7wpK0booljV/RKqyQklf0/Odr64mqm78x4DmXsElzTw9r9+SXVvrM/AA== X-Received: by 2002:a05:6820:168a:b0:57d:e76d:c206 with SMTP id bc10-20020a056820168a00b0057de76dc206mr5693974oob.1.1700406828402; Sun, 19 Nov 2023 07:13:48 -0800 (PST) Received: from [172.31.0.109] ([136.36.130.248]) by smtp.gmail.com with ESMTPSA id c17-20020a4ad8d1000000b0058a0809ea25sm1069944oov.21.2023.11.19.07.13.47 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 19 Nov 2023 07:13:47 -0800 (PST) Message-ID: <9174593a-066b-4735-86f3-51a670c3fbae@gmail.com> Date: Sun, 19 Nov 2023 08:13:47 -0700 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH] testsuite: analyzer: expect alignment warning with -fshort-enums Content-Language: en-US To: Alexandre Oliva , gcc-patches@gcc.gnu.org Cc: David Malcolm , Rainer Orth , Mike Stump , Jason Merrill , Nathan Sidwell References: From: Jeff Law In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-2.3 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,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: On 11/19/23 00:36, Alexandre Oliva wrote: > > On targets that have -fshort-enums enabled by default, the type casts > in the pr108251 analyzer tests warn that the byte-aligned enums may > not be sufficiently aligned to be a struct connection *. The function > can't know better, the warning is reasonable, the code doesn't > expected enums to be shorter and less aligned than the struct. > > Rather than use -fno-short-enums, I decided to embrace the warning on > targets that have short_enums enabled by default. > > However, C++ doesn't issue the warning, because even with > -fshort-enums, enumeration types are not TYPE_PACKED, and the > expression is not sufficiently simplified by the C++ front-end for > check_and_warn_address_or_pointer_of_packed_member to identify the > insufficiently aligned pointer. So don't expect the warning there. > > (I've got followup patches in testing to get the same warnings in C++) > > Regstrapped on x86_64-linux-gnu, also tested on arm-eabi with default > cpu on trunk, and with tms570 on gcc-13. Ok to install? > > > for gcc/testsuite/ChangeLog > > * c-c++-common/analyzer/null-deref-pr108251-smp_fetch_ssl_fc_has_early-O2.c: > Expect "unaligned pointer value" warning on short_enums > targets, but not in c++. > * c-c++-common/analyzer/null-deref-pr108251-smp_fetch_ssl_fc_has_early.c: > Likewise. OK. Hell of a filename for a single test :-) jeff