On Tue, Jun 9, 2020 at 2:56 PM Alex Butler <alex.but...@arm.com> wrote: > > Replaced for consistency with the rest of the aarch64 backend. > > Testing done: > Cross-compiled and regression tested on aarch64-none-elf, no issues.
If we 100% know the size of the buffer that passes to sprintf is reasonable for the format (max sized dealing with integer and not bounded with string sizes), using sprintf should not be a problem and using snprintf does not make a difference and might even cause problems later on since the 64 is hardcoded in two places rather than one. Thanks, Andrew Pinski > > --- > gcc/ChangeLog: > > 2020-04-08 Alex Butler <alex.but...@arm.com> > > * config/aarch64/aarch64.md (cb<optab><mode>1): Replace > sprintf with snprintf > > --- > aarch64.md | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/gcc/config/aarch64/aarch64.md b/gcc/config/aarch64/aarch64.md > index > c7c4d1dd519af6c9df03ba74e7b6ade5f122b4d8..94247cf019e1701843d3a77b352c0b81dec4fbff > 100644 > --- a/gcc/config/aarch64/aarch64.md > +++ b/gcc/config/aarch64/aarch64.md > @@ -953,7 +953,7 @@ > char buf[64]; > uint64_t val = ((uint64_t) 1) > << (GET_MODE_SIZE (<MODE>mode) * BITS_PER_UNIT - 1); > - sprintf (buf, "tst\t%%<w>0, %" PRId64, val); > + snprintf (buf, 64, "tst\t%%<w>0, %" PRId64, val); > output_asm_insn (buf, operands); > return "<bcond>\t%l1"; > }