From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by sourceware.org (Postfix) with ESMTPS id 87EEA3858D37 for ; Mon, 20 Nov 2023 22:19:29 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 87EEA3858D37 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 87EEA3858D37 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=170.10.129.124 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1700518770; cv=none; b=FXTEM7/xKmJ9U9Pu7GWlGkTrt+ViwIMW4nlh30m+73UvQFsYQuOJDO+TJqjMWSxSKBr0cAxCV98Z4PqN+ZLbzloyq+kfjKVP/LqKkGEoNpFhIMihItU2HEeOdK4J+DxSePThzzRKCvof+wq9wGGj+wofw4ubIBqtEPbhX0IYKGk= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1700518770; c=relaxed/simple; bh=D6xCrA2BLiYpUeD8o8Uz0PL59Dsnz7+JexvkcpubK14=; h=DKIM-Signature:Message-ID:Subject:From:To:Date:MIME-Version; b=da+SvCTK9Gh875CS7k5l85CWgyKWmzdHzPjlBwem+i+zImRyHUCVieFbUxYkyvd8cwnrNNdiSo5xFT6Q7Fs3/MqpEggP1scilTbrBYuaBoq8PerfGH7CFtvQKyJstMVmNe0Ez5lyUL6Ujypgt1BpY8FJ6l8kYHUxMXcmZU1VGlY= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1700518769; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=s5P80Uvug3hooqDv7xU78QSabg/lnV/DKybUDoJ0+p0=; b=D/SReBW8JJ/Di1ExTLHIaI5v/1WAa5Q2xLDRuSlB9fzSF1izzJajkeMpZyO1fhUC4b5+bV 4sL2TPodZngH6OXDsZEvqOW5+rH/ebaFCVFvikxohQGVUDrcAGZnXwQEhIdNftgAEAKPlp 0x7QZsAXItpHk6kALF/YjSJ9FH9Fjbc= Received: from mail-qv1-f71.google.com (mail-qv1-f71.google.com [209.85.219.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-211-E_1w00OnO--crUhsedKr0A-1; Mon, 20 Nov 2023 17:19:25 -0500 X-MC-Unique: E_1w00OnO--crUhsedKr0A-1 Received: by mail-qv1-f71.google.com with SMTP id 6a1803df08f44-66d155fc53eso35184146d6.1 for ; Mon, 20 Nov 2023 14:19:25 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1700518765; x=1701123565; h=mime-version:user-agent:content-transfer-encoding:references :in-reply-to:date:cc:to:from:subject:message-id:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=s5P80Uvug3hooqDv7xU78QSabg/lnV/DKybUDoJ0+p0=; b=MMfAyyNidqNSwbH3Tc7vh7U2UK1CrkyBGgyDwhTVjJpB+NU6KDKfdd596Aa//CjnJ0 FN/7/SC2gxptP40XdI4lFINCIqeGAHvPAB4pDYJ6RzoAxuOtWU95cZV5O6FfGW9u5bkM GWqtmhXkNSgOBEPdfjIIxmQar0nLU80qexJ5hyhCSM2B21KHXXqxccJyRWNe1y7Thvqy SHOfsmR+FLRMFa1ZmTIRG30kNSYVFct/FNb7MLFVPuspISSmSTKIqmazOCXBReeacVHj EBdVxZTubrsYy9patJ0LoIAyE81dHkXpt+Zrw2xcOzQjlGTl4idBHDZROhOEHvIas5Oi /K3g== X-Gm-Message-State: AOJu0YzWtcu5hgFtDvXwJSJ9T8oWbe7X0LdC0lATWTqyNuyp+MCtok11 LU5+TTdRv5voGFrN8x1DxQtSQRNeHjlnemMyfvYl3de7y0vEWR/L+9T8lZukeX7mrstdaunMIxz rxtLCpkK2apvYkCWslQ== X-Received: by 2002:a0c:f30a:0:b0:679:e85f:d962 with SMTP id j10-20020a0cf30a000000b00679e85fd962mr1274374qvl.27.1700518765462; Mon, 20 Nov 2023 14:19:25 -0800 (PST) X-Google-Smtp-Source: AGHT+IGyCeH+VL9+eQU1fiQay6rGKtvzHFfwE0qbeinzPWRsLrUtCWfZcZqopshjXXTTACPC73umoQ== X-Received: by 2002:a0c:f30a:0:b0:679:e85f:d962 with SMTP id j10-20020a0cf30a000000b00679e85fd962mr1274354qvl.27.1700518765183; Mon, 20 Nov 2023 14:19:25 -0800 (PST) Received: from t14s.localdomain (c-76-28-97-5.hsd1.ma.comcast.net. [76.28.97.5]) by smtp.gmail.com with ESMTPSA id j16-20020a0cc350000000b0066cf2423c79sm3262634qvi.139.2023.11.20.14.19.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 20 Nov 2023 14:19:24 -0800 (PST) Message-ID: Subject: Re: [PATCH] testsuite: analyzer: expect alignment warning with -fshort-enums From: David Malcolm To: Jeff Law , Alexandre Oliva , gcc-patches@gcc.gnu.org Cc: Rainer Orth , Mike Stump , Jason Merrill , Nathan Sidwell Date: Mon, 20 Nov 2023 17:19:23 -0500 In-Reply-To: <9174593a-066b-4735-86f3-51a670c3fbae@gmail.com> References: <9174593a-066b-4735-86f3-51a670c3fbae@gmail.com> User-Agent: Evolution 3.44.4 (3.44.4-2.fc36) MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-3.8 required=5.0 tests=BAYES_00,BODY_8BITS,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_NONE,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 Sun, 2023-11-19 at 08:13 -0700, Jeff Law wrote: >=20 >=20 > On 11/19/23 00:36, Alexandre Oliva wrote: > >=20 > > 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 *.=C2=A0 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. > >=20 > > Rather than use -fno-short-enums, I decided to embrace the warning > > on > > targets that have short_enums enabled by default. > >=20 > > 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.=C2=A0 So don't expect the warning there= . > >=20 > > (I've got followup patches in testing to get the same warnings in > > C++) > >=20 > > Regstrapped on x86_64-linux-gnu, also tested on arm-eabi with > > default > > cpu on trunk, and with tms570 on gcc-13.=C2=A0 Ok to install? > >=20 > >=20 > > for=C2=A0 gcc/testsuite/ChangeLog > >=20 > > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0* c-c++-common/analyzer= /null-deref-pr108251- > > smp_fetch_ssl_fc_has_early-O2.c: > > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0Expect "unaligned point= er value" warning on short_enums > > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0targets, but not in c++= . > > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0* c-c++-common/analyzer= /null-deref-pr108251- > > smp_fetch_ssl_fc_has_early.c: > > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0Likewise. > OK.=C2=A0 Hell of a filename for a single test :-) Sorry about that, I have lots of test names of the form prNNNNNN and wanted something more descriptive. Clearly I overcorrected :) Dave