re PR middle-end/31095 (ICE in expand_expr_real_1, at expr.c:8786)

2007-05-22  Andrew Pinski  <andrew_pinski@playstation.sony.com>

        PR middle-end/31095
         * builtins.c (expand_builtin_memmove_args): Strip nops that don't
        change the type before looking for a COMPOUND_EXPR.

2007-05-22  Andrew Pinski  <andrew_pinski@playstation.sony.com>

        PR middle-end/31095
        * gcc.c-torture/compile/bcopy-1.c: New testcase.

From-SVN: r124975
This commit is contained in:
Andrew Pinski 2007-05-23 01:17:14 +00:00 committed by Andrew Pinski
parent 6a57dd4f38
commit 1809a5208f
4 changed files with 26 additions and 0 deletions

View File

@ -1,3 +1,9 @@
2007-05-22 Andrew Pinski <andrew_pinski@playstation.sony.com>
PR middle-end/31095
* builtins.c (expand_builtin_memmove_args): Strip nops that don't
change the type before looking for a COMPOUND_EXPR.
2007-05-22 Ian Lance Taylor <iant@google.com>
* lower-subreg.c (decompose_multiword_subregs): If we change an

View File

@ -3485,6 +3485,7 @@ expand_builtin_memmove_args (tree dest, tree src, tree len,
if (result)
{
STRIP_TYPE_NOPS (result);
while (TREE_CODE (result) == COMPOUND_EXPR)
{
expand_expr (TREE_OPERAND (result, 0), const0_rtx, VOIDmode,

View File

@ -1,3 +1,8 @@
2007-05-22 Andrew Pinski <andrew_pinski@playstation.sony.com>
PR middle-end/31095
* gcc.c-torture/compile/bcopy-1.c: New testcase.
2007-05-22 Andrew Pinski <andrew_pinski@playstation.sony.com>
PR middle-end/31606

View File

@ -0,0 +1,14 @@
/* PR middle-end/31095, expand_builtin_memmove_args forgot to take into
account that tree folding of builtins can add an extra NOP_EXPR. */
struct timeval
{
int tv_sec;
int tv_usec;
};
void
capture_next_packet (void)
{
struct timeval past, now, then;
__builtin_bcopy (&then, &past, sizeof (then));
}