compiler: report error for ++/-- applied to a non-numeric type

This avoids a compiler crash.

Fixes GCC PR 83071.

Change-Id: I199f5e0277bea3a4aca834ff4afd56c92a194361
Reviewed-on: https://go-review.googlesource.com/78875
Reviewed-by: Than McIntosh <thanm@google.com>
diff --git a/go/statements.cc b/go/statements.cc
index b22f690..e977980 100644
--- a/go/statements.cc
+++ b/go/statements.cc
@@ -1826,6 +1826,11 @@
 Inc_dec_statement::do_lower(Gogo*, Named_object*, Block*, Statement_inserter*)
 {
   Location loc = this->location();
+  if (!this->expr_->type()->is_numeric_type())
+    {
+      this->report_error("increment or decrement of non-numeric type");
+      return Statement::make_error_statement(loc);
+    }
   Expression* oexpr = Expression::make_integer_ul(1, this->expr_->type(), loc);
   Operator op = this->is_inc_ ? OPERATOR_PLUSEQ : OPERATOR_MINUSEQ;
   return Statement::make_assignment_operation(op, this->expr_, oexpr, loc);