From c9e9c3ac4d6554fc26f540b95ad3f1ef9eccfc26 Mon Sep 17 00:00:00 2001 From: Senthil Kumar Selvaraj Date: Tue, 25 Apr 2017 12:06:04 +0000 Subject: [PATCH] Fix broken attr-alloc_size-10.c for avr Integer promotion combined with equal sizes for short and int (16 bits) causes overflow warnings when expanding the TEST macro for USHRT_MAX. Fix by explicitly disabling overflow warnings for targets with !int32plus. gcc/testsuite/ 2017-04-25 Senthil Kumar Selvaraj * gcc.dg/attr-alloc_size-10.c: Ignore overflow warnings for targets with int size less than 32 bits. From-SVN: r247203 --- gcc/testsuite/ChangeLog | 5 +++++ gcc/testsuite/gcc.dg/attr-alloc_size-10.c | 3 ++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 409725c46bf..fd6b9fa902b 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2017-04-25 Senthil Kumar Selvaraj + + * gcc.dg/attr-alloc_size-10.c: Ignore overflow warnings + for targets with int size less than 32 bits. + 2017-04-25 Richard Biener PR tree-optimization/79201 diff --git a/gcc/testsuite/gcc.dg/attr-alloc_size-10.c b/gcc/testsuite/gcc.dg/attr-alloc_size-10.c index d7a0a987003..40807171ff0 100644 --- a/gcc/testsuite/gcc.dg/attr-alloc_size-10.c +++ b/gcc/testsuite/gcc.dg/attr-alloc_size-10.c @@ -4,7 +4,8 @@ range. { dg-do compile } - { dg-options "-O2 -Walloc-size-larger-than=12" } */ + { dg-options "-O2 -Walloc-size-larger-than=12" } + { dg-options "-Wno-overflow" { target { ! int32plus } } } */ #define SCHAR_MAX __SCHAR_MAX__ #define SCHAR_MIN (-SCHAR_MAX - 1) -- 2.30.2