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  <senthil_kumar.selvaraj@atmel.com>

	* gcc.dg/attr-alloc_size-10.c: Ignore overflow warnings
	for targets with int size less than 32 bits.

From-SVN: r247203
This commit is contained in:
Senthil Kumar Selvaraj 2017-04-25 12:06:04 +00:00 committed by Senthil Kumar Selvaraj
parent 904a2ae4e3
commit c9e9c3ac4d
2 changed files with 7 additions and 1 deletions

View File

@ -1,3 +1,8 @@
2017-04-25 Senthil Kumar Selvaraj <senthil_kumar.selvaraj@atmel.com>
* gcc.dg/attr-alloc_size-10.c: Ignore overflow warnings
for targets with int size less than 32 bits.
2017-04-25 Richard Biener <rguenther@suse.de>
PR tree-optimization/79201

View File

@ -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)