From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pg1-x533.google.com (mail-pg1-x533.google.com [IPv6:2607:f8b0:4864:20::533]) by sourceware.org (Postfix) with ESMTPS id 182F13858408 for ; Mon, 20 Nov 2023 02:35:06 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 182F13858408 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=adacore.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=adacore.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 182F13858408 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2607:f8b0:4864:20::533 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1700447707; cv=none; b=YOeltPCvYdBPc2zFb1xtmoJ7bDhy/nofAlTh1++KNrGFRM+GSi57ilwVd+RkBSeS1iZzMyY7oMWTwSIDNjBb4tx5EyDDFYxjx3M7DgnbAWBCWxTzgCARizYP7Q4j0+o3tc7JjCjsCVQVbRUDue1V6cSPKP90GlGZwzm6xZ/6hkY= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1700447707; c=relaxed/simple; bh=o8Sk4a9aUhqfSqYxj4xvj6rGocnCU3tB4xPneN4CUgQ=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=QM8zL1GFwkezwGp8RTYSZLuSMCPaaviMRElLPmqJxWw/xodYnSiCSvchslVEqQwX4iDO7WhsyRtnLA4mNZ+NodgFiZcgRiCd07MeAxqw5629fDbQrsVi79B2t6tiLNhQM8zqa4+uP2MKb8C4TLStfUn12NxOQQXLlXcBzw6DKT0= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-pg1-x533.google.com with SMTP id 41be03b00d2f7-5bd099e3d3cso2058957a12.1 for ; Sun, 19 Nov 2023 18:35:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=adacore.com; s=google; t=1700447705; x=1701052505; darn=gcc.gnu.org; h=mime-version:user-agent:message-id:in-reply-to:date:references :organization:subject:cc:to:from:from:to:cc:subject:date:message-id :reply-to; bh=+bgNdCd9bOhRhl1dZ/XsNVLGmzh1697E5fjbt95bXNU=; b=KrwcivE4xuxuxwJwQ1DkVux7N1u7FZZKEaOb6mONfyCRv2U662qw8ypYmZbNVgfvsx AH0ppRD7kmCPTGX4cu4iCyZZgzw9OL99xOvjpKZTj5aTBVIN7JW25Y7djKkRyuUNrUo8 soda2ItvNAnurrqSJdWWCvtqpxdSmovvjIOTQqKlfudwiRdmEkqOwZQ7YTNJHayWBdHo RKmI3pAgeNGIQN2aHgxlkELmspoP4x5qJzTwnAdTGjjJaErlRdzvPZuXjGWg+O90tnFp BWLyyq78HUACDFbrXf99Ar4VC1kRilFgCBbFpT8btJQFKxtt8EVGpvep+CFkQFGHhY+Z x9hw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1700447705; x=1701052505; h=mime-version:user-agent:message-id:in-reply-to:date:references :organization:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=+bgNdCd9bOhRhl1dZ/XsNVLGmzh1697E5fjbt95bXNU=; b=fJC/C/sKvw+Ehvr6X8nRW21pBqqKfapHwuj4C7/vB+WDGIQeYBvy61GfQDCM+tvntv vgvXt4aMpNv9YfM+A1Kj5MYev5FTC95nZAYfrMoTisQmvK4QmeoFhWVkqc/uPGwZ76CM QLFvUE5IPOhl3sIe+owrSvAZ1nT1P0L6Vx+QorWEs4oOBvZCra24BJHjcjkKqTF2ExNG ZIaq4tlzBdbgAETxOIhlRx6LQ1IUhdCnqr+f3zy+dNDYiArIUTzbYDq5WzgK00gis58X ImPnWjGB/YMhTSoCqe55ufeoHFAer0tZU6e8flFkpkevvidlWIQjzZENSgtUCtUjCQhu sAfA== X-Gm-Message-State: AOJu0YxpFB+SyelHJb7xSBv5YlLbGohsLPhvEyFwUjgJYzJPX2JG+EYS oEBlDmdGMtf3JNV9SVG31bRga0g5cdpCkYiCVZk= X-Google-Smtp-Source: AGHT+IFRzvvaoWHTw97ibQwWoTj7JVUnqP2JIVlW5gX1EeOlEx4+7YHUbYSMXp5kWOe1xN7pSFphFA== X-Received: by 2002:a05:6a21:6d8f:b0:187:60da:475f with SMTP id wl15-20020a056a216d8f00b0018760da475fmr4877316pzb.50.1700447704731; Sun, 19 Nov 2023 18:35:04 -0800 (PST) Received: from free.home ([2804:7f1:2080:51b3:d545:cbee:40c0:c7a7]) by smtp.gmail.com with ESMTPSA id u15-20020a17090341cf00b001c7283d3089sm4877009ple.273.2023.11.19.18.35.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 19 Nov 2023 18:35:04 -0800 (PST) Received: from livre (livre.home [172.31.160.2]) by free.home (8.15.2/8.15.2) with ESMTPS id 3AK2YuME146703 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT); Sun, 19 Nov 2023 23:34:56 -0300 From: Alexandre Oliva To: gcc-patches@gcc.gnu.org Cc: David Malcolm , Rainer Orth , Mike Stump , Jason Merrill , Nathan Sidwell Subject: [PATCH #4/4] testsuite: discard c++ exclusion on underaligned pointer warning Organization: Free thinker, does not speak for AdaCore References: Date: Sun, 19 Nov 2023 23:34:56 -0300 In-Reply-To: (Alexandre Oliva's message of "Sun, 19 Nov 2023 04:36:23 -0300") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Scanned-By: MIMEDefang 2.84 X-Spam-Status: No, score=-12.3 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,GIT_PATCH_0,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,TXREP,T_SCC_BODY_TEXT_LINE,WEIRD_QUOTING 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: Having extended check_and_warn_address_or_pointer_of_packed_member to find the packed (short) enum pointer in the cast expression coming from the C++ front-end, and amended the C++ front end to mark short enums as TYPE_PACKED, C++ issues the same warning that C does for c-c++-common/analyzer/null-deref-pr108251-smp_fetch_ssl_fc_has_early.c, so drop the exclusion. 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 warning in C++ as well. * c-c++-common/analyzer/null-deref-pr108251-smp_fetch_ssl_fc_has_early.c: Likewise. --- ...-deref-pr108251-smp_fetch_ssl_fc_has_early-O2.c | 2 +- ...ull-deref-pr108251-smp_fetch_ssl_fc_has_early.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/gcc/testsuite/c-c++-common/analyzer/null-deref-pr108251-smp_fetch_ssl_fc_has_early-O2.c b/gcc/testsuite/c-c++-common/analyzer/null-deref-pr108251-smp_fetch_ssl_fc_has_early-O2.c index aaa2031b6dca4..bf5bf5cc2e278 100644 --- a/gcc/testsuite/c-c++-common/analyzer/null-deref-pr108251-smp_fetch_ssl_fc_has_early-O2.c +++ b/gcc/testsuite/c-c++-common/analyzer/null-deref-pr108251-smp_fetch_ssl_fc_has_early-O2.c @@ -61,7 +61,7 @@ static inline enum obj_type obj_type(const enum obj_type *t) } static inline struct connection *__objt_conn(enum obj_type *t) { - return ((struct connection *)(((char *)(t)) - ((long)&((struct connection *)0)->obj_type))); /* { dg-warning "unaligned pointer value" "warning" { target { short_enums && { ! c++ } } } } */ + return ((struct connection *)(((char *)(t)) - ((long)&((struct connection *)0)->obj_type))); /* { dg-warning "unaligned pointer value" "warning" { target short_enums } } */ } static inline struct connection *objt_conn(enum obj_type *t) { diff --git a/gcc/testsuite/c-c++-common/analyzer/null-deref-pr108251-smp_fetch_ssl_fc_has_early.c b/gcc/testsuite/c-c++-common/analyzer/null-deref-pr108251-smp_fetch_ssl_fc_has_early.c index 6c96f5a76ef1c..7c2710c64d35e 100644 --- a/gcc/testsuite/c-c++-common/analyzer/null-deref-pr108251-smp_fetch_ssl_fc_has_early.c +++ b/gcc/testsuite/c-c++-common/analyzer/null-deref-pr108251-smp_fetch_ssl_fc_has_early.c @@ -60,7 +60,7 @@ static inline enum obj_type obj_type(const enum obj_type *t) } static inline struct connection *__objt_conn(enum obj_type *t) { - return ((struct connection *)(((char *)(t)) - ((long)&((struct connection *)0)->obj_type))); /* { dg-warning "unaligned pointer value" "warning" { target { short_enums && { ! c++ } } } } */ + return ((struct connection *)(((char *)(t)) - ((long)&((struct connection *)0)->obj_type))); /* { dg-warning "unaligned pointer value" "warning" { target short_enums } } */ } static inline struct connection *objt_conn(enum obj_type *t) { -- Alexandre Oliva, happy hacker https://FSFLA.org/blogs/lxo/ Free Software Activist GNU Toolchain Engineer More tolerance and less prejudice are key for inclusion and diversity Excluding neuro-others for not behaving ""normal"" is *not* inclusive