cvt.c (cp_convert_and_check): Avoid calling cp_convert unnecessarily.

2013-11-26  Paolo Carlini  <paolo.carlini@oracle.com>

	* cvt.c (cp_convert_and_check): Avoid calling cp_convert
	unnecessarily.

From-SVN: r205387
This commit is contained in:
Paolo Carlini 2013-11-26 10:12:30 +00:00 committed by Paolo Carlini
parent 793c28b87f
commit d2504d682b
2 changed files with 7 additions and 1 deletions

View File

@ -1,3 +1,8 @@
2013-11-26 Paolo Carlini <paolo.carlini@oracle.com>
* cvt.c (cp_convert_and_check): Avoid calling cp_convert
unnecessarily.
2013-11-25 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/54485

View File

@ -630,7 +630,8 @@ cp_convert_and_check (tree type, tree expr, tsubst_flags_t complain)
{
tree folded = maybe_constant_value (expr);
tree stripped = folded;
tree folded_result = cp_convert (type, folded, complain);
tree folded_result
= folded != expr ? cp_convert (type, folded, complain) : result;
/* maybe_constant_value wraps an INTEGER_CST with TREE_OVERFLOW in a
NOP_EXPR so that it isn't TREE_CONSTANT anymore. */