aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp/call.c
diff options
context:
space:
mode:
authorMark Mitchell <mark@codesourcery.com>2003-08-28 07:14:26 +0000
committerMark Mitchell <mmitchel@gcc.gnu.org>2003-08-28 07:14:26 +0000
commit22bd385b2b2c5e3a8b2bc1370cd576b75195d72e (patch)
tree33b46f58435734419c1a15c485d745d9839d668d /gcc/cp/call.c
parent45dff86efa42f35786a2624ff70d7304d3e7ef77 (diff)
downloadgcc-22bd385b2b2c5e3a8b2bc1370cd576b75195d72e.zip
gcc-22bd385b2b2c5e3a8b2bc1370cd576b75195d72e.tar.gz
gcc-22bd385b2b2c5e3a8b2bc1370cd576b75195d72e.tar.bz2
re PR rtl-optimization/5079 (Reference to static const int not eliminated during optimization)
PR optimization/5079 * call.c (build_conditional_expr): Use decl_constant_value to simplify the arguments. PR optimization/5079 * g++.dg/opt/static3.C: New test. From-SVN: r70881
Diffstat (limited to 'gcc/cp/call.c')
-rw-r--r--gcc/cp/call.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/gcc/cp/call.c b/gcc/cp/call.c
index a74fd63..739ce71 100644
--- a/gcc/cp/call.c
+++ b/gcc/cp/call.c
@@ -3358,6 +3358,8 @@ build_conditional_expr (tree arg1, tree arg2, tree arg3)
}
valid_operands:
+ arg2 = decl_constant_value (arg2);
+ arg3 = decl_constant_value (arg3);
result = fold (build (COND_EXPR, result_type, arg1, arg2, arg3));
/* We can't use result_type below, as fold might have returned a
throw_expr. */