diff options
author | Kai Tietz <ktietz@redhat.com> | 2011-10-21 13:50:42 +0200 |
---|---|---|
committer | Kai Tietz <ktietz@gcc.gnu.org> | 2011-10-21 13:50:42 +0200 |
commit | bb35fdd04a97dc08eb7cc391dfcf0bbe2a90501a (patch) | |
tree | 9ac919557fdac1b5fb2da7af700ccda6d7a9e938 /gcc/fold-const.c | |
parent | b867358a067a4a6b8d1a53222f562ab9f6b616c5 (diff) | |
download | gcc-bb35fdd04a97dc08eb7cc391dfcf0bbe2a90501a.zip gcc-bb35fdd04a97dc08eb7cc391dfcf0bbe2a90501a.tar.gz gcc-bb35fdd04a97dc08eb7cc391dfcf0bbe2a90501a.tar.bz2 |
branch-cost1.c: New test.
* gcc.target/i386/branch-cost1.c: New test.
* gcc.target/i386/branch-cost2.c: New test.
* gcc.target/i386/branch-cost3.c: New test.
* gcc.target/i386/branch-cost4.c: New test.
* fold-const.c (simple_operand_p_2): Handle integral
casts from boolean-operands.
From-SVN: r180295
Diffstat (limited to 'gcc/fold-const.c')
-rw-r--r-- | gcc/fold-const.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/gcc/fold-const.c b/gcc/fold-const.c index dc14576..a838c34 100644 --- a/gcc/fold-const.c +++ b/gcc/fold-const.c @@ -3695,23 +3695,23 @@ simple_operand_p (const_tree exp) /* Subroutine for fold_truth_andor: determine if an operand is simple enough to be evaluated unconditionally. - I addition to simple_operand_p, we assume that comparisons and logic-not - operations are simple, if their operands are simple, too. */ + I addition to simple_operand_p, we assume that comparisons, conversions, + and logic-not operations are simple, if their operands are simple, too. */ static bool simple_operand_p_2 (tree exp) { enum tree_code code; - /* Strip any conversions that don't change the machine mode. */ - STRIP_NOPS (exp); - - code = TREE_CODE (exp); - if (TREE_SIDE_EFFECTS (exp) || tree_could_trap_p (exp)) return false; + while (CONVERT_EXPR_P (exp)) + exp = TREE_OPERAND (exp, 0); + + code = TREE_CODE (exp); + if (TREE_CODE_CLASS (code) == tcc_comparison) return (simple_operand_p (TREE_OPERAND (exp, 0)) && simple_operand_p (TREE_OPERAND (exp, 1))); |