re PR middle-end/89998 (ICE: verify_gimple failed in printf-return-value)
authorJakub Jelinek <jakub@redhat.com>
Tue, 9 Apr 2019 10:26:13 +0000 (12:26 +0200)
committerJakub Jelinek <jakub@gcc.gnu.org>
Tue, 9 Apr 2019 10:26:13 +0000 (12:26 +0200)
commita73468e8c724fa76eccdf33835e9705a37e21381
treec3c993e2eb3474b5c54bb81a3cc2a3e1f059865d
parent1c67e69c0dea67fab1ef32e8b78bf24cc1b3f06a
re PR middle-end/89998 (ICE: verify_gimple failed in printf-return-value)

PR tree-optimization/89998
* gimple-ssa-sprintf.c (try_substitute_return_value): Use lhs type
instead of integer_type_node if possible, don't add ranges if return
type is not compatible with int.
* gimple-fold.c (gimple_fold_builtin_sprintf,
gimple_fold_builtin_snprintf): Use lhs type instead of hardcoded
integer_type_node.

* gcc.c-torture/compile/pr89998-1.c: New test.
* gcc.c-torture/compile/pr89998-2.c: New test.

From-SVN: r270224
gcc/ChangeLog
gcc/gimple-fold.c
gcc/gimple-ssa-sprintf.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.c-torture/compile/pr89998-1.c [new file with mode: 0644]
gcc/testsuite/gcc.c-torture/compile/pr89998-2.c [new file with mode: 0644]