diff --git a/external/gpl3/gcc/dist/gcc/config/vax/builtins.md b/external/gpl3/gcc/dist/gcc/config/vax/builtins.md
index 17dac16c2daf..a9cfc478e2db 100644
--- a/external/gpl3/gcc/dist/gcc/config/vax/builtins.md
+++ b/external/gpl3/gcc/dist/gcc/config/vax/builtins.md
@@ -32,12 +32,15 @@
 
 (define_expand "ffssi2"
   [(set (match_operand:SI 0 "nonimmediate_operand" "")
-	(ffs:SI (match_operand:SI 1 "general_operand" "")))]
+	(ffs:SI (match_operand:SI 1 "general_operand" "")))
+   (set (cc0)
+	 (compare (match_dup 0) (const_int 0)))
+	 ]
   ""
   "
 {
   rtx label = gen_label_rtx ();
-  emit_insn (gen_ctzsi2 (operands[0], operands[1]));
+  emit_insn (gen_count_zero (operands[0], operands[1]));
   emit_jump_insn (gen_condjump (gen_rtx_NE(VOIDmode, cc0_rtx, const0_rtx), label));
   emit_move_insn (operands[0], constm1_rtx);
   emit_label (label);
@@ -46,12 +49,25 @@
 }")
 
 (define_insn "ctzsi2"
-  [(set (match_operand:SI 0 "nonimmediate_operand" "=rQ")
-	(ctz:SI (match_operand:SI 1 "general_operand" "nrQT")))
-   (set (cc0) (match_dup 0))]
+  [ (set (match_operand:SI 0 "nonimmediate_operand" "=rQ")
+         (ctz:SI (match_operand:SI 1 "general_operand" "nrQT")))
+    (set (cc0)
+	 (compare (match_dup 0) (const_int 0)))
+   ]
+  ""
+  "ffs $0,$32,%1,%0\;tstl %0")
+
+(define_insn "count_zero"
+  [ (set (match_operand:SI 0 "nonimmediate_operand" "")
+         (ctz:SI (match_operand:SI 1 "general_operand" "")))
+    (set (cc0)
+	 (compare (match_dup 0)
+		  (const_int 33)))
+  ]
   ""
   "ffs $0,$32,%1,%0")
 
+
 (define_expand "sync_lock_test_and_set<mode>"
   [(set (match_operand:VAXint 0 "nonimmediate_operand" "=&g")
 	(unspec:VAXint [(match_operand:VAXint 1 "memory_operand" "+m")