]> git.ipfire.org Git - thirdparty/gcc.git/commit
re PR middle-end/50865 (Invalid code generation for INT64_MIN % 1 on x86_64)
authorJakub Jelinek <jakub@redhat.com>
Sat, 9 Jan 2016 07:37:04 +0000 (08:37 +0100)
committerJakub Jelinek <jakub@gcc.gnu.org>
Sat, 9 Jan 2016 07:37:04 +0000 (08:37 +0100)
commit20b8d7342cc4920c79aebc0317150abe66068957
tree45e51c7b289d01fdbda2b9323067a5127cd78f76
parentc50e614be6bb98f8a67f6fda4f73b412b035329d
re PR middle-end/50865 (Invalid code generation for INT64_MIN % 1 on x86_64)

PR middle-end/50865
PR tree-optimization/69097
* fold-const.h (expr_not_equal_to): New prototype.
* fold-const.c: Include stringpool.h and tree-ssanames.h.
(expr_not_equal_to): New function.
* match.pd (X % -Y is the same as X % Y): Don't optimize
unless X is known not to be equal to minimum or Y is known
not to be equal to -1.
* tree-vrp.c (simplify_div_or_mod_using_ranges): Add GSI argument.
fold TRUNC_MOD_EXPR if the second argument is not a power of two.
(simplify_stmt_using_ranges): Adjust caller.
(vrp_finalize): Call set_value_range on SSA_NAMEs before calling
substitute_and_fold.

* gcc.c-torture/execute/pr50865.c: New test.
* gcc.c-torture/execute/pr69097-1.c: New test.
* gcc.c-torture/execute/pr69097-2.c: New test.
* gcc.dg/pr69097-1.c: New test.
* gcc.dg/pr69097-2.c: New test.

From-SVN: r232188
gcc/ChangeLog
gcc/fold-const.c
gcc/fold-const.h
gcc/match.pd
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.c-torture/execute/pr50865.c [new file with mode: 0644]
gcc/testsuite/gcc.c-torture/execute/pr69097-1.c [new file with mode: 0644]
gcc/testsuite/gcc.c-torture/execute/pr69097-2.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/pr69097-1.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/pr69097-2.c [new file with mode: 0644]
gcc/tree-vrp.c