From ad67619912f1bdde64fe20e686cbf775db78f08e Mon Sep 17 00:00:00 2001 From: rguenth Date: Fri, 14 Oct 2011 11:03:06 +0000 Subject: [PATCH] 2011-10-14 Richard Guenther PR tree-optimization/50723 * ipa-split.c (split_function): Use GSI_CONTINUE_LINKING. * gcc.dg/torture/pr50723.c: New testcase. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@179967 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/ChangeLog | 5 +++++ gcc/ipa-split.c | 2 +- gcc/testsuite/ChangeLog | 5 +++++ gcc/testsuite/gcc.dg/torture/pr50723.c | 26 ++++++++++++++++++++++++++ 4 files changed, 37 insertions(+), 1 deletion(-) create mode 100644 gcc/testsuite/gcc.dg/torture/pr50723.c diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 5c82e9b..d9cfc33 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2011-10-14 Richard Guenther + + PR tree-optimization/50723 + * ipa-split.c (split_function): Use GSI_CONTINUE_LINKING. + 2011-10-14 Nicola Pero * gengtype.c (files_rules): Added rules for objc/objc-map.h and diff --git a/gcc/ipa-split.c b/gcc/ipa-split.c index 75cc619..7e0769f 100644 --- a/gcc/ipa-split.c +++ b/gcc/ipa-split.c @@ -1134,7 +1134,7 @@ split_function (struct split_point *split_point) if (!is_gimple_val (arg)) { arg = force_gimple_operand_gsi (&gsi, arg, true, NULL_TREE, - false, GSI_NEW_STMT); + false, GSI_CONTINUE_LINKING); VEC_replace (tree, args_to_pass, i, arg); } call = gimple_build_call_vec (node->decl, args_to_pass); diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 28d8308..d168fe1 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2011-10-14 Richard Guenther + + PR tree-optimization/50723 + * gcc.dg/torture/pr50723.c: New testcase. + 2011-10-14 Paolo Carlini PR c++/17212 diff --git a/gcc/testsuite/gcc.dg/torture/pr50723.c b/gcc/testsuite/gcc.dg/torture/pr50723.c new file mode 100644 index 0000000..24e490f --- /dev/null +++ b/gcc/testsuite/gcc.dg/torture/pr50723.c @@ -0,0 +1,26 @@ +/* { dg-do compile } */ + +typedef short unsigned int wchar_t; +typedef unsigned int size_t; +int* _errno(void); +int WideCharToMultiByte (wchar_t *); +int __attribute__ ((__nonnull__ (1))) +__wcrtomb_cp (char *dst, wchar_t wc, const unsigned int cp, + const unsigned int mb_max) +{ + if (cp == 0) { + if (wc > 255) + (*_errno()) = 42; + return 1; + } + else + return WideCharToMultiByte (&wc); +} +void wcsrtombs (char *dst, const wchar_t *pwc, unsigned int cp, + unsigned int mb_max) +{ + if ((__wcrtomb_cp (dst, *pwc, cp, mb_max)) <= 0) + return; + if ((__wcrtomb_cp (dst, *pwc, cp, mb_max)) <= 0) + return; +} -- 2.7.4