This adds another check that might have saved me a little time
recently if it had been present.
	* config/tc-ppc.c (insn_validate): Check that optional operands
	are not followed by non-optional operands.
+2018-11-06  Alan Modra  <amodra@gmail.com>
+
+       * config/tc-ppc.c (insn_validate): Check that optional operands
+       are not followed by non-optional operands.
+
 2018-11-06  Jan Beulich  <jbeulich@suse.com>
 
        * testsuite/gas/i386/evex-wig.s: Add vpbroadcastd cases.
 
   /* The operands must not overlap the opcode or each other.  */
   for (o = op->operands; *o; ++o)
     {
+      bfd_boolean optional = FALSE;
       if (*o >= num_powerpc_operands)
         {
          as_bad (_("operand index error for %s"), op->name);
                }
              omask |= mask;
            }
+         if ((operand->flags & PPC_OPERAND_OPTIONAL) != 0)
+           optional = TRUE;
+         else if (optional)
+           {
+             as_bad (_("non-optional operand %d follows optional operand in %s"),
+                     (int) (o - op->operands), op->name);
+             return TRUE;
+           }
         }
     }
   return FALSE;