From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2140) id D2BD63858403; Sun, 19 Nov 2023 08:19:04 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org D2BD63858403 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1700381944; bh=uSi9zfsO5X9vvjb5PLpoLr3BpyITEn0J7M0OrVCqC5s=; h=From:To:Subject:Date:From; b=Sgeg93+lGuXfYEI7+na1lUtOg6mcccpZbEzqJS5Iz6BiqhGpLWxW6p/ZD2XkZQCXw yfRsye6O/J9osXLT+W5fGPerXzdnSgc4FBWtubrByQLO8ZG/vbPcDSAQON/QaIEHPI Hoz9urndRjO2hMkjpwdlHL06m2kjEpokFlMCFNfw= Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: Alexandre Oliva To: gcc-cvs@gcc.gnu.org Subject: [gcc(refs/users/aoliva/heads/testme)] testsuite: discard c++ exclusion on underaligned pointer warning X-Act-Checkin: gcc X-Git-Author: Alexandre Oliva X-Git-Refname: refs/users/aoliva/heads/testme X-Git-Oldrev: 75749d7bfe815368fc388740d9b1ac0ae9d568f0 X-Git-Newrev: bec44fdc5bfdca7c538f3508a3d987f28c0e9613 Message-Id: <20231119081904.D2BD63858403@sourceware.org> Date: Sun, 19 Nov 2023 08:19:04 +0000 (GMT) List-Id: https://gcc.gnu.org/g:bec44fdc5bfdca7c538f3508a3d987f28c0e9613 commit bec44fdc5bfdca7c538f3508a3d987f28c0e9613 Author: Alexandre Oliva Date: Sun Nov 19 01:26:50 2023 -0300 testsuite: discard c++ exclusion on underaligned pointer warning 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. 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. Diff: --- .../analyzer/null-deref-pr108251-smp_fetch_ssl_fc_has_early-O2.c | 2 +- .../analyzer/null-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 aaa2031b6dc..bf5bf5cc2e2 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 6c96f5a76ef..7c2710c64d3 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) {