diff options
author | Richard Guenther <rguenther@suse.de> | 2005-09-09 09:00:42 +0000 |
---|---|---|
committer | Richard Biener <rguenth@gcc.gnu.org> | 2005-09-09 09:00:42 +0000 |
commit | 3dac16bde876e6ef586bed692a5c52015d230188 (patch) | |
tree | 063d723468f59c5153bc0412704ffd0946b73ba1 /gcc/fold-const.c | |
parent | dcfae47c5e2507e490b278ae5db3365b31c9654e (diff) | |
download | gcc-3dac16bde876e6ef586bed692a5c52015d230188.tar.gz |
re PR c++/23624 (ICE: internal compiler error: in invert_truthvalue, at fold-const.c:2697)
2005-09-09 Richard Guenther <rguenther@suse.de>
PR c++/23624
* fold-const.c (fold_ternary): Check truth_value_p before
calling invert_truthvalue.
* g++.dg/tree-ssa/pr23624.C: New testcase.
From-SVN: r104083
Diffstat (limited to 'gcc/fold-const.c')
-rw-r--r-- | gcc/fold-const.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/gcc/fold-const.c b/gcc/fold-const.c index 2f024b42e02..4b41adfc59f 100644 --- a/gcc/fold-const.c +++ b/gcc/fold-const.c @@ -10006,7 +10006,8 @@ fold_ternary (enum tree_code code, tree type, tree op0, tree op1, tree op2) /* If the second operand is simpler than the third, swap them since that produces better jump optimization results. */ - if (tree_swap_operands_p (op1, op2, false)) + if (truth_value_p (TREE_CODE (arg0)) + && tree_swap_operands_p (op1, op2, false)) { /* See if this can be inverted. If it can't, possibly because it was a floating-point inequality comparison, don't do |