diff mbox

[avr,committed] : Fix build warning for -1 in unsigned int initializers.

Message ID 536CC7A9.9060305@gjlay.de
State New
Headers show

Commit Message

Georg-Johann Lay May 9, 2014, 12:18 p.m. UTC
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.



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

Patch

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)]);