public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH AArch64]Fix spurious warning with explicit initialization
@ 2016-08-11 10:02 Bin Cheng
  0 siblings, 0 replies; only message in thread
From: Bin Cheng @ 2016-08-11 10:02 UTC (permalink / raw)
  To: gcc-patches; +Cc: nd

[-- Attachment #1: Type: text/plain, Size: 429 bytes --]

Hi,
GCC gives spurious -Wmaybe-uninitialized message which breaks bootstrap.  This patch fixes it by explicitly initializing.  Also I file PR72355 in order to tracking the wrong warning message.
Compilation log checked.  Applied as obvious.

Thanks,
bin

2016-08-11  Bin Cheng  <bin.cheng@arm.com>

	* config/aarch64/aarch64-simd.md (vec_cmp<mode><v_cmp_result>: Init
	variable explicitly, also assert on it before use.

[-- Attachment #2: fix-spurious-warning-msg.txt --]
[-- Type: text/plain, Size: 939 bytes --]

diff --git a/gcc/config/aarch64/aarch64-simd.md b/gcc/config/aarch64/aarch64-simd.md
index 37d397c..3817895 100644
--- a/gcc/config/aarch64/aarch64-simd.md
+++ b/gcc/config/aarch64/aarch64-simd.md
@@ -2413,7 +2413,7 @@
   enum rtx_code code = GET_CODE (operands[1]);
   rtx tmp = gen_reg_rtx (<V_cmp_result>mode);
 
-  rtx (*comparison) (rtx, rtx, rtx);
+  rtx (*comparison) (rtx, rtx, rtx) = NULL;
 
   switch (code)
     {
@@ -2495,6 +2495,7 @@
 	 a UNLE b -> !(a GT b)
 	 a UNLT b -> !(a GE b)
 	 a   NE b -> !(a EQ b)  */
+      gcc_assert (comparison != NULL);
       emit_insn (comparison (operands[0], operands[2], operands[3]));
       emit_insn (gen_one_cmpl<v_cmp_result>2 (operands[0], operands[0]));
       break;
@@ -2511,6 +2512,7 @@
 	 a LE b -> b GE a
 	 a LT b -> b GT a
 	 a EQ b -> a EQ b  */
+      gcc_assert (comparison != NULL);
       emit_insn (comparison (operands[0], operands[2], operands[3]));
       break;
 

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

only message in thread, other threads:[~2016-08-11 10:02 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-08-11 10:02 [PATCH AArch64]Fix spurious warning with explicit initialization Bin Cheng

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