--- i/tree_sitter/core/lib/src/parser.c
+++ w/tree_sitter/core/lib/src/parser.c
@@ -2084,6 +2084,10 @@ void ts_parser_reset(TSParser *self) {
   self->parse_state = (TSParseState) {0};
 }
 
+// FIXME: see tree-sitter/py-tree-sitter#330
+#if __GNUC__ >= 14 && defined(__aarch64__) && defined(__OPTIMIZE__) && !defined(__OPTIMIZE_SIZE__)
+__attribute__((optimize(2)))
+#endif
 TSTree *ts_parser_parse(
   TSParser *self,
   const TSTree *old_tree,
