[Bug tree-optimization/69097] [6 Regression] wrong code at -O1 and above on x86_64-linux-gnu
jakub at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Sat Jan 9 07:37:00 GMT 2016
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69097
--- Comment #6 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Author: jakub
Date: Sat Jan 9 07:37:04 2016
New Revision: 232188
URL: https://gcc.gnu.org/viewcvs?rev=232188&root=gcc&view=rev
Log:
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.
Added:
trunk/gcc/testsuite/gcc.c-torture/execute/pr50865.c
trunk/gcc/testsuite/gcc.c-torture/execute/pr69097-1.c
trunk/gcc/testsuite/gcc.c-torture/execute/pr69097-2.c
trunk/gcc/testsuite/gcc.dg/pr69097-1.c
trunk/gcc/testsuite/gcc.dg/pr69097-2.c
Modified:
trunk/gcc/ChangeLog
trunk/gcc/fold-const.c
trunk/gcc/fold-const.h
trunk/gcc/match.pd
trunk/gcc/testsuite/ChangeLog
trunk/gcc/tree-vrp.c
More information about the Gcc-bugs
mailing list