This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Fix format_integer (PR tree-optimization/78586)


On 11/29/2016 12:48 PM, Jakub Jelinek wrote:
Hi!

As mentioned in the PR, the LSHIFT_EXPR computation of values that
will need longest or shortest string is both incorrect (it shifts
integer_one_node left, so for precisions above precision of integer
it returns 0 (not to mention that it is invalid GENERIC, because the types
of first operand and result have to match)) and unnecessary - every integral
type already has TYPE_MIN_VALUE and TYPE_MAX_VALUE readily available.

Bootstrapped/regtested on x86_64-linux and i686-linux, ok for trunk?

Note, in the PR I've raised various further questions, Martin, can you look
at them?

Sure.  I replied in the bug.

Thanks for fixing this!  My only comment is that it would be nice
to have the test in the builtin-sprintf-*.c series as a compile-only
test.  I often check them with my cross-compilers which I can't do
with tests that require running.  If you prefer to keep it as is
I'll go ahead and add one like it that's compile-only.

Martin


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]