From 892955bff08d660ba36d42e32f3b7a0c7d3acd61 Mon Sep 17 00:00:00 2001 From: Roger Sayle Date: Tue, 9 Sep 2003 19:20:42 +0000 Subject: builtins.c (fold_builtin_cabs): Protect the complex argument against multiple evaluation when... * builtins.c (fold_builtin_cabs): Protect the complex argument against multiple evaluation when optimizing cabs* into sqrt*. From-SVN: r71242 --- gcc/ChangeLog | 5 +++++ gcc/builtins.c | 2 ++ 2 files changed, 7 insertions(+) (limited to 'gcc') diff --git a/gcc/ChangeLog b/gcc/ChangeLog index d103a85..6754c80 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2003-09-09 Roger Sayle + + * builtins.c (fold_builtin_cabs): Protect the complex argument + against multiple evaluation when optimizing cabs* into sqrt*. + Tue Sep 9 15:36:28 CEST 2003 Jan Hubicka * varasm.c (notice_global_symbol): Properly deal with weak symbols. diff --git a/gcc/builtins.c b/gcc/builtins.c index 290fac49..92e6a70 100644 --- a/gcc/builtins.c +++ b/gcc/builtins.c @@ -5718,6 +5718,8 @@ fold_builtin_cabs (tree fndecl, tree arglist, tree type) { tree rpart, ipart, result, arglist; + arg = save_expr (arg); + rpart = fold (build1 (REALPART_EXPR, type, arg)); ipart = fold (build1 (IMAGPART_EXPR, type, arg)); -- cgit v1.1