compiler: use correct size and comparison in index value overflow check

This has apparently been wrong since I introduced the code ten years ago.

Fixes https://gcc.gnu.org/PR114500

Change-Id: I8ddc6a7bbb45647065ba4f20f6932122487749e2
Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/574835
Reviewed-by: Ian Lance Taylor <iant@google.com>
Reviewed-by: Than McIntosh <thanm@google.com>
diff --git a/go/expressions.cc b/go/expressions.cc
index 8429e55..238d5a5 100644
--- a/go/expressions.cc
+++ b/go/expressions.cc
@@ -18790,7 +18790,7 @@
 
 	  Named_type* ntype = Type::lookup_integer_type("int");
 	  Integer_type* inttype = ntype->integer_type();
-	  if (sizeof(index) <= static_cast<size_t>(inttype->bits() * 8)
+	  if (sizeof(index) >= static_cast<size_t>(inttype->bits() / 8)
 	      && index >> (inttype->bits() - 1) != 0)
 	    {
 	      go_error_at(index_expr->location(), "index value overflow");