2014-11-26 Richard Biener <rguenther@suse.de>
authorrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 26 Nov 2014 14:39:43 +0000 (14:39 +0000)
committerrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 26 Nov 2014 14:39:43 +0000 (14:39 +0000)
commit6d31c916e0682010ba9a3d2c1c7647201c28883c
tree8513d233a582b2c8a38f6db93929f5a48aaf43a8
parent13a78ad1136316949733262f5370a346394be242
2014-11-26  Richard Biener  <rguenther@suse.de>

* fold-const.h (const_unop): Declare.
(const_binop): Likewise.
* fold-const.c (const_binop): Export overload that expects
a type parameter and dispatches to fold_relational_const as well.
Check both operand kinds for guarding the transforms.
(const_unop): New function, with constant folding from fold_unary_loc.
(fold_unary_loc): Dispatch to const_unop for tcc_constant operand.
Remove constant folding done there from the simplifications.
(fold_binary_loc): Check for constants using CONSTANT_CLASS_P.
(fold_negate_expr): Remove dead code from the REAL_CST case.
Avoid building garbage in the COMPLEX_CST case.
* gimple-match-head.c (gimple_resimplify1): Dispatch to
const_unop.
(gimple_resimplify2): Dispatch to const_binop.
(gimple_simplify): Likewise.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@218086 138bc75d-0d04-0410-961f-82ee72b054a4
gcc/ChangeLog
gcc/fold-const.c
gcc/fold-const.h
gcc/gimple-match-head.c