aboutsummaryrefslogtreecommitdiff
path: root/gcc/c-common.c
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2009-03-17 18:46:23 +0100
committerJakub Jelinek <jakub@gcc.gnu.org>2009-03-17 18:46:23 +0100
commit6b2b88712792698e1348e585ab91fa8518a250f0 (patch)
tree1561d673290eb404bb41c2a5161a6ff3f15f7b15 /gcc/c-common.c
parent16e60c1706a8abf971d1ae216a33cc7e2f29e3c5 (diff)
downloadgcc-6b2b88712792698e1348e585ab91fa8518a250f0.zip
gcc-6b2b88712792698e1348e585ab91fa8518a250f0.tar.gz
gcc-6b2b88712792698e1348e585ab91fa8518a250f0.tar.bz2
re PR middle-end/39443 (Builtin redirection no longer working for memcmp)
PR middle-end/39443 * optabs.c (set_user_assembler_libfunc): New function. * expr.h (set_user_assembler_libfunc): New prototype. * c-common.c: Include libfuncs.h. (set_builtin_user_assembler_name): Call set_user_assembler_libfunc for memcmp, memset, memcpy, memmove and abort. * Makefile.in (c-common.o): Depend on libfuncs.h. * gcc.dg/pr39443.c: New test. From-SVN: r144910
Diffstat (limited to 'gcc/c-common.c')
-rw-r--r--gcc/c-common.c27
1 files changed, 23 insertions, 4 deletions
diff --git a/gcc/c-common.c b/gcc/c-common.c
index a84113f..cc00511 100644
--- a/gcc/c-common.c
+++ b/gcc/c-common.c
@@ -51,6 +51,7 @@ along with GCC; see the file COPYING3. If not see
#include "target-def.h"
#include "gimple.h"
#include "fixed-value.h"
+#include "libfuncs.h"
cpp_reader *parse_in; /* Declared in c-pragma.h. */
@@ -4401,10 +4402,28 @@ set_builtin_user_assembler_name (tree decl, const char *asmspec)
builtin = built_in_decls [DECL_FUNCTION_CODE (decl)];
set_user_assembler_name (builtin, asmspec);
- if (DECL_FUNCTION_CODE (decl) == BUILT_IN_MEMCPY)
- init_block_move_fn (asmspec);
- else if (DECL_FUNCTION_CODE (decl) == BUILT_IN_MEMSET)
- init_block_clear_fn (asmspec);
+ switch (DECL_FUNCTION_CODE (decl))
+ {
+ case BUILT_IN_MEMCPY:
+ init_block_move_fn (asmspec);
+ memcpy_libfunc = set_user_assembler_libfunc ("memcpy", asmspec);
+ break;
+ case BUILT_IN_MEMSET:
+ init_block_clear_fn (asmspec);
+ memset_libfunc = set_user_assembler_libfunc ("memset", asmspec);
+ break;
+ case BUILT_IN_MEMMOVE:
+ memmove_libfunc = set_user_assembler_libfunc ("memmove", asmspec);
+ break;
+ case BUILT_IN_MEMCMP:
+ memcmp_libfunc = set_user_assembler_libfunc ("memcmp", asmspec);
+ break;
+ case BUILT_IN_ABORT:
+ abort_libfunc = set_user_assembler_libfunc ("abort", asmspec);
+ break;
+ default:
+ break;
+ }
}
/* The number of named compound-literals generated thus far. */