diff mbox series

[v2] testsuite: xfail test for short_enums

Message ID 20240311102259.3091375-1-torbjorn.svensson@foss.st.com
State New
Headers show
Series [v2] testsuite: xfail test for short_enums | expand

Commit Message

Torbjörn SVENSSON March 11, 2024, 10:23 a.m. UTC
Changes compared to v1:
- Added reference to r14-6517-gb7e4a4c626e in dg-bogus comment
- Changed arm-*-* to short_enums in target selector
- Updated commit message to align with above changes


As the entire block generating the warning was removed in
r14-6517-gb7e4a4c626e, does it still make sense to add something to
trunk for the same line?
Do you want me to add the dg-bogus, but change "xfail" to "target" for
trunk?

Is this patch ok for releases/gcc-13?

--

On arm-none-eabi, the test case fails with
.../null-deref-pr108251-smp_fetch_ssl_fc_has_early-O2.c:63:65: warning: converting a packed 'enum obj_type' pointer (alignment 1) to a 'struct connection' pointer (alignment 4) may result in an unaligned pointer value [-Waddress-of-packed-member]

The error was fixed in basepoints/gcc-14-6517-gb7e4a4c626e, but it
was considered to be a too big change to be backported and thus, the
failing test is marked xfail in GCC13.

gcc/testsuite/ChangeLog:

	* gcc.dg/analyzer/null-deref-pr108251-smp_fetch_ssl_fc_has_early-O2.c:
	Added dg-bogus with xfail on offending line for short_enums.

Signed-off-by: Torbjörn SVENSSON <torbjorn.svensson@foss.st.com>
---
 .../null-deref-pr108251-smp_fetch_ssl_fc_has_early-O2.c         | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Jason Merrill March 12, 2024, 1:21 p.m. UTC | #1
On 3/11/24 06:23, Torbjörn SVENSSON wrote:
> Changes compared to v1:
> - Added reference to r14-6517-gb7e4a4c626e in dg-bogus comment
> - Changed arm-*-* to short_enums in target selector
> - Updated commit message to align with above changes
> 
> 
> As the entire block generating the warning was removed in
> r14-6517-gb7e4a4c626e, does it still make sense to add something to
> trunk for the same line?
> Do you want me to add the dg-bogus, but change "xfail" to "target" for
> trunk?

Sounds good.

> Is this patch ok for releases/gcc-13?

OK.

> --
> 
> On arm-none-eabi, the test case fails with
> .../null-deref-pr108251-smp_fetch_ssl_fc_has_early-O2.c:63:65: warning: converting a packed 'enum obj_type' pointer (alignment 1) to a 'struct connection' pointer (alignment 4) may result in an unaligned pointer value [-Waddress-of-packed-member]
> 
> The error was fixed in basepoints/gcc-14-6517-gb7e4a4c626e, but it
> was considered to be a too big change to be backported and thus, the
> failing test is marked xfail in GCC13.
> 
> gcc/testsuite/ChangeLog:
> 
> 	* gcc.dg/analyzer/null-deref-pr108251-smp_fetch_ssl_fc_has_early-O2.c:
> 	Added dg-bogus with xfail on offending line for short_enums.
> 
> Signed-off-by: Torbjörn SVENSSON <torbjorn.svensson@foss.st.com>
> ---
>   .../null-deref-pr108251-smp_fetch_ssl_fc_has_early-O2.c         | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/gcc/testsuite/gcc.dg/analyzer/null-deref-pr108251-smp_fetch_ssl_fc_has_early-O2.c b/gcc/testsuite/gcc.dg/analyzer/null-deref-pr108251-smp_fetch_ssl_fc_has_early-O2.c
> index 2a9c715c32c..e8cde7338a0 100644
> --- a/gcc/testsuite/gcc.dg/analyzer/null-deref-pr108251-smp_fetch_ssl_fc_has_early-O2.c
> +++ b/gcc/testsuite/gcc.dg/analyzer/null-deref-pr108251-smp_fetch_ssl_fc_has_early-O2.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 *)(((void *)(t)) - ((long)&((struct connection *)0)->obj_type)));
> + return ((struct connection *)(((void *)(t)) - ((long)&((struct connection *)0)->obj_type))); /* { dg-bogus "may result in an unaligned pointer value" "Fixed in r14-6517-gb7e4a4c626e" { xfail short_enums } */
>   }
>   static inline struct connection *objt_conn(enum obj_type *t)
>   {
Torbjörn SVENSSON March 13, 2024, 2:22 p.m. UTC | #2
On 2024-03-12 14:21, Jason Merrill wrote:
> On 3/11/24 06:23, Torbjörn SVENSSON wrote:
>> Changes compared to v1:
>> - Added reference to r14-6517-gb7e4a4c626e in dg-bogus comment
>> - Changed arm-*-* to short_enums in target selector
>> - Updated commit message to align with above changes
>>
>>
>> As the entire block generating the warning was removed in
>> r14-6517-gb7e4a4c626e, does it still make sense to add something to
>> trunk for the same line?
>> Do you want me to add the dg-bogus, but change "xfail" to "target" for
>> trunk?
> 
> Sounds good.

Pushed as basepoints/gcc-14-9452-g5a44e14eb4f

> 
>> Is this patch ok for releases/gcc-13?
> 
> OK.

Pushed as releases/gcc-13.2.0-824-g1277f69b9b0

Kind regards,
Torbjörn
diff mbox series

Patch

diff --git a/gcc/testsuite/gcc.dg/analyzer/null-deref-pr108251-smp_fetch_ssl_fc_has_early-O2.c b/gcc/testsuite/gcc.dg/analyzer/null-deref-pr108251-smp_fetch_ssl_fc_has_early-O2.c
index 2a9c715c32c..e8cde7338a0 100644
--- a/gcc/testsuite/gcc.dg/analyzer/null-deref-pr108251-smp_fetch_ssl_fc_has_early-O2.c
+++ b/gcc/testsuite/gcc.dg/analyzer/null-deref-pr108251-smp_fetch_ssl_fc_has_early-O2.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 *)(((void *)(t)) - ((long)&((struct connection *)0)->obj_type)));
+ return ((struct connection *)(((void *)(t)) - ((long)&((struct connection *)0)->obj_type))); /* { dg-bogus "may result in an unaligned pointer value" "Fixed in r14-6517-gb7e4a4c626e" { xfail short_enums } */
 }
 static inline struct connection *objt_conn(enum obj_type *t)
 {