public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [patch,avr,committed]: Fix build warning for -1 in unsigned int initializers.
@ 2014-05-09 12:18 Georg-Johann Lay
  0 siblings, 0 replies; only message in thread
From: Georg-Johann Lay @ 2014-05-09 12:18 UTC (permalink / raw)
  To: GCC Patches, Denis Chertykov

http://gcc.gnu.org/ml/gcc-cvs/2014-05/msg00311.html

Hi, applied this obvious patch to trunk in order to fix build warnings like these:

gcc/config/avr/avr-fixed.md:434:59: warning: narrowing conversion of ‘-1’ from 
‘int’ to ‘const unsigned int’ inside { } is ill-formed in C++11 [-Wnarrowing]


Thanks, Johann


gcc/
	* config/avr/avr-fixed.md (round<mode>3): Use -1U instead of -1 in
	unsigned int initializers for regno_in, regno_out.



Index: config/avr/avr-fixed.md
===================================================================
--- config/avr/avr-fixed.md     (revision 210271)
+++ config/avr/avr-fixed.md     (working copy)
@@ -430,8 +430,8 @@ (define_expand "round<mode>3"
        }

      // Input and output of the libgcc function
-    const unsigned int regno_in[]  = { -1, 22, 22, -1, 18 };
-    const unsigned int regno_out[] = { -1, 24, 24, -1, 22 };
+    const unsigned int regno_in[]  = { -1U, 22, 22, -1U, 18 };
+    const unsigned int regno_out[] = { -1U, 24, 24, -1U, 22 };

      operands[3] = gen_rtx_REG (<MODE>mode, regno_out[(size_t) GET_MODE_SIZE 
(<MODE>mode)]);
      operands[4] = gen_rtx_REG (<MODE>mode,  regno_in[(size_t) GET_MODE_SIZE 
(<MODE>mode)]);

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

only message in thread, other threads:[~2014-05-09 12:18 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-05-09 12:18 [patch,avr,committed]: Fix build warning for -1 in unsigned int initializers Georg-Johann Lay

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