From aa6c7c3a3a02b5518c9a1398145160ddf8df2f56 Mon Sep 17 00:00:00 2001 From: Roger Sayle Date: Thu, 10 Jun 2004 19:46:03 +0000 Subject: [PATCH] builtins.c (expand_builtin): Fall back to library function call for conj... * builtins.c (expand_builtin): Fall back to library function call for conj, conjf, conjl, creal, crealf, creall, cimag, cimagf and cimagl. (fold_builtin_1): Lower built-ins BUILT_IN_CONJ{,F,L} to CONJ_EXPR, BUILT_IN_CREAL{,F,L} to REALPART_EXPR, and BUILT_IN_CIMAG{,F,L} to IMAGPART_EXPR respectively. From-SVN: r82938 --- gcc/ChangeLog | 8 ++++++++ gcc/builtins.c | 36 +++++++++++++++++++++++------------- 2 files changed, 31 insertions(+), 13 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index ef9d7a37620..9bf98563d42 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,11 @@ +2004-06-10 Roger Sayle + + * builtins.c (expand_builtin): Fall back to library function call for + conj, conjf, conjl, creal, crealf, creall, cimag, cimagf and cimagl. + (fold_builtin_1): Lower built-ins BUILT_IN_CONJ{,F,L} to CONJ_EXPR, + BUILT_IN_CREAL{,F,L} to REALPART_EXPR, and BUILT_IN_CIMAG{,F,L} to + IMAGPART_EXPR respectively. + 2004-06-10 J"orn Rennecke * sh.c (dump_table): New argument start. Changed caller. diff --git a/gcc/builtins.c b/gcc/builtins.c index 384173f2bd2..199900e2228 100644 --- a/gcc/builtins.c +++ b/gcc/builtins.c @@ -5656,19 +5656,6 @@ expand_builtin (tree exp, rtx target, rtx subtarget, enum machine_mode mode, } break; - case BUILT_IN_CONJ: - case BUILT_IN_CONJF: - case BUILT_IN_CONJL: - case BUILT_IN_CREAL: - case BUILT_IN_CREALF: - case BUILT_IN_CREALL: - case BUILT_IN_CIMAG: - case BUILT_IN_CIMAGF: - case BUILT_IN_CIMAGL: - /* expand_tree_builtin changes these into CONJ_EXPR, REALPART_EXPR - and IMAGPART_EXPR. */ - abort (); - case BUILT_IN_EXP: case BUILT_IN_EXPF: case BUILT_IN_EXPL: @@ -7670,6 +7657,29 @@ fold_builtin_1 (tree exp) case BUILT_IN_IMAXABS: return fold_builtin_abs (arglist, type); + case BUILT_IN_CONJ: + case BUILT_IN_CONJF: + case BUILT_IN_CONJL: + if (validate_arglist (arglist, COMPLEX_TYPE, VOID_TYPE)) + return fold (build1 (CONJ_EXPR, type, TREE_VALUE (arglist))); + break; + + case BUILT_IN_CREAL: + case BUILT_IN_CREALF: + case BUILT_IN_CREALL: + if (validate_arglist (arglist, COMPLEX_TYPE, VOID_TYPE)) + return non_lvalue (fold (build1 (REALPART_EXPR, type, + TREE_VALUE (arglist)))); + break; + + case BUILT_IN_CIMAG: + case BUILT_IN_CIMAGF: + case BUILT_IN_CIMAGL: + if (validate_arglist (arglist, COMPLEX_TYPE, VOID_TYPE)) + return non_lvalue (fold (build1 (IMAGPART_EXPR, type, + TREE_VALUE (arglist)))); + break; + case BUILT_IN_CABS: case BUILT_IN_CABSF: case BUILT_IN_CABSL: -- 2.30.2