public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [Patch, testsuite] Fix failing attr-alloc_size-10.c for avr
@ 2017-04-25 12:48 Senthil Kumar Selvaraj
  0 siblings, 0 replies; only message in thread
From: Senthil Kumar Selvaraj @ 2017-04-25 12:48 UTC (permalink / raw)
  To: GCC Patches

Hi,

Integer promotion combined with equal sizes for short and int (16 bits)
causes overflow warnings when expanding the TEST macro for USHRT_MAX.

Fixed by explicitly disabling overflow warnings for targets with !int32plus.

Committed as obvious.

Regards
Senthil


gcc/testsuite/ChangeLog

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.


Index: gcc/testsuite/gcc.dg/attr-alloc_size-10.c
===================================================================
--- gcc/testsuite/gcc.dg/attr-alloc_size-10.c	(revision 247191)
+++ gcc/testsuite/gcc.dg/attr-alloc_size-10.c	(working copy)
@@ -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)

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2017-04-25 12:09 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-04-25 12:48 [Patch, testsuite] Fix failing attr-alloc_size-10.c for avr Senthil Kumar Selvaraj

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).