This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]