From: Paolo Carlini Date: Tue, 26 Nov 2013 10:12:30 +0000 (+0000) Subject: cvt.c (cp_convert_and_check): Avoid calling cp_convert unnecessarily. X-Git-Tag: releases/gcc-4.9.0~2454 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=d2504d682b036c369b6068ed2bf471161464aef0;p=thirdparty%2Fgcc.git cvt.c (cp_convert_and_check): Avoid calling cp_convert unnecessarily. 2013-11-26 Paolo Carlini * cvt.c (cp_convert_and_check): Avoid calling cp_convert unnecessarily. From-SVN: r205387 --- diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 64f9a23632db..143885cea1c2 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,8 @@ +2013-11-26 Paolo Carlini + + * cvt.c (cp_convert_and_check): Avoid calling cp_convert + unnecessarily. + 2013-11-25 Paolo Carlini PR c++/54485 diff --git a/gcc/cp/cvt.c b/gcc/cp/cvt.c index c1dfdcf3599f..ecec24a51185 100644 --- a/gcc/cp/cvt.c +++ b/gcc/cp/cvt.c @@ -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. */