Commit 892955bf by Roger Sayle Committed by Roger Sayle

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
parent 086a4bd7
2003-09-09 Roger Sayle <roger@eyesopen.com>
* 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 <jh@suse.cz> Tue Sep 9 15:36:28 CEST 2003 Jan Hubicka <jh@suse.cz>
* varasm.c (notice_global_symbol): Properly deal with weak symbols. * varasm.c (notice_global_symbol): Properly deal with weak symbols.
......
...@@ -5718,6 +5718,8 @@ fold_builtin_cabs (tree fndecl, tree arglist, tree type) ...@@ -5718,6 +5718,8 @@ fold_builtin_cabs (tree fndecl, tree arglist, tree type)
{ {
tree rpart, ipart, result, arglist; tree rpart, ipart, result, arglist;
arg = save_expr (arg);
rpart = fold (build1 (REALPART_EXPR, type, arg)); rpart = fold (build1 (REALPART_EXPR, type, arg));
ipart = fold (build1 (IMAGPART_EXPR, type, arg)); ipart = fold (build1 (IMAGPART_EXPR, type, arg));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment