aarch64: Fix valid_src_p for use of uninitialized value
authorAndrea Corallo <andrea.corallo@arm.com>
Thu, 9 Apr 2020 14:34:50 +0000 (15:34 +0100)
committerAndrea Corallo <andrea.corallo@arm.com>
Wed, 15 Apr 2020 13:00:05 +0000 (15:00 +0200)
2020-04-15  Andrea Corallo  <andrea.corallo@arm.com>

* config/aarch64/falkor-tag-collision-avoidance.c
(valid_src_p): Check for aarch64_address_info type before
accessing base field.

gcc/ChangeLog
gcc/config/aarch64/falkor-tag-collision-avoidance.c

index 80e21dced64c34099d715fc14e5888c7b4546512..55f2e96732523818656158e4bdc96baf79519136 100644 (file)
@@ -1,3 +1,9 @@
+2020-04-15  Andrea Corallo  <andrea.corallo@arm.com>
+
+       * config/aarch64/falkor-tag-collision-avoidance.c
+       (valid_src_p): Check for aarch64_address_info type before
+       accessing base field.
+
 2020-04-15  Andre Vieira  <andre.simoesdiasvieira@arm.com>
 
        * config/arm/mve.md (mve_vec_duplicate<mode>): New pattern.
index f850153fae02ed8ff906486071c815d4eab5d4b2..a96a3320e8fc36b58d58776b99abcd2b09922663 100644 (file)
@@ -538,7 +538,11 @@ valid_src_p (rtx src, rtx_insn *insn, struct loop *loop, bool *pre_post,
   if (!aarch64_classify_address (&addr, XEXP (x, 0), mode, true))
     return false;
 
-  if (!REG_P (addr.base))
+  if (addr.type != ADDRESS_REG_IMM
+      && addr.type != ADDRESS_REG_WB
+      && addr.type != ADDRESS_REG_REG
+      && addr.type != ADDRESS_REG_UXTW
+      && addr.type != ADDRESS_REG_SXTW)
     return false;
 
   unsigned regno = REGNO (addr.base);