diff options
author | paolo <paolo@138bc75d-0d04-0410-961f-82ee72b054a4> | 2013-11-26 10:12:30 +0000 |
---|---|---|
committer | paolo <paolo@138bc75d-0d04-0410-961f-82ee72b054a4> | 2013-11-26 10:12:30 +0000 |
commit | b65fb3db14b811bd34792897e8596a27f7364dd1 (patch) | |
tree | bab7c9238ed7c2ef897e1e1b7b47414a0ec2c78e /gcc/cp | |
parent | 6ae2e2f1c166d5202ba93609f64dd44c78431340 (diff) | |
download | gcc-b65fb3db14b811bd34792897e8596a27f7364dd1.tar.gz |
2013-11-26 Paolo Carlini <paolo.carlini@oracle.com>
* cvt.c (cp_convert_and_check): Avoid calling cp_convert
unnecessarily.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@205387 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/cp')
-rw-r--r-- | gcc/cp/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/cp/cvt.c | 3 |
2 files changed, 7 insertions, 1 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 64f9a23632d..143885cea1c 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -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 diff --git a/gcc/cp/cvt.c b/gcc/cp/cvt.c index c1dfdcf3599..ecec24a5118 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. */ |