]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
Fix sprintf length warning
authorJan-Benedict Glaw <jbglaw@lug-owl.de>
Wed, 24 May 2023 14:35:22 +0000 (16:35 +0200)
committerJan-Benedict Glaw <jbglaw@lug-owl.de>
Wed, 24 May 2023 14:35:22 +0000 (16:35 +0200)
One of the supplied argument strings is unneccesarily long (c-sky, using
basically the same code, fixed it to a shorter length) and this fixes overflow
warnings, as GCC fails to deduce that the full 256 bytes for load_op[] are
not used at all.

gcc/ChangeLog:

* config/mcore/mcore.cc (output_inline_const) Make buffer smaller to
silence overflow warnings later on.

gcc/config/mcore/mcore.cc

index 92e7f960f75c550aa3319c17a69375a27f3f1c17..e933b03cdff54850cf58cfd5b3c2a1035285d136 100644 (file)
@@ -1182,7 +1182,7 @@ output_inline_const (machine_mode mode, rtx operands[])
   int trick_no;
   rtx out_operands[3];
   char buf[256];
-  char load_op[256];
+  char load_op[128];
   const char *dst_fmt;
   HOST_WIDE_INT value;