AArch64: Replace C initializers with memset
authorTamar Christina <tamar.christina@arm.com>
Mon, 8 Oct 2018 12:33:42 +0000 (13:33 +0100)
committerTamar Christina <tamar.christina@arm.com>
Mon, 8 Oct 2018 12:42:37 +0000 (13:42 +0100)
Clang doesn't accept {0} as a valid C struct initializer under their implementation
of -Wmissing-field-initializers.  This makes using C initializers a bit tricky.

Instead I'm changing the code to use memset instead, which at least GCC inlines and
generates the same code for.  This also seems to be the idiom used in binutils for
most targets.

opcodes/

* aarch64-opc.c (verify_constraints): Use memset instead of {0}.

opcodes/ChangeLog
opcodes/aarch64-opc.c

index 27ca2da7dfb53b624c5c483f69a1ec1194c52aec..64070471c440ae5db6a3b61d86bdd162c1751839 100644 (file)
@@ -1,3 +1,7 @@
+2018-10-08  Tamar Christina  <tamar.christina@arm.com>
+
+       * aarch64-opc.c (verify_constraints): Use memset instead of {0}.
+
 2018-10-05  H.J. Lu  <hongjiu.lu@intel.com>
 
        * i386-dis.c (rm_table): Add enclv.
index 3f62e2a9fc41c9dc9b0031a387bada35d7287115..ed75a9a77ea74486d8a81db5b2248b39547c45f3 100644 (file)
@@ -4671,7 +4671,9 @@ verify_constraints (const struct aarch64_inst *inst,
 
          /* Next check for usage of the predicate register.  */
          aarch64_opnd_info blk_dest = insn_sequence->instr->operands[0];
-         aarch64_opnd_info blk_pred = {0}, inst_pred = {0};
+         aarch64_opnd_info blk_pred, inst_pred;
+         memset (&blk_pred, 0, sizeof (aarch64_opnd_info));
+         memset (&inst_pred, 0, sizeof (aarch64_opnd_info));
          bfd_boolean predicated = FALSE;
          assert (blk_dest.type == AARCH64_OPND_SVE_Zd);
 
This page took 0.027117 seconds and 4 git commands to generate.