diff options
| -rw-r--r-- | gcc/ChangeLog | 6 | ||||
| -rw-r--r-- | gcc/builtins.c | 1 | ||||
| -rw-r--r-- | gcc/testsuite/ChangeLog | 5 | ||||
| -rw-r--r-- | gcc/testsuite/gcc.c-torture/compile/bcopy-1.c | 14 |
4 files changed, 26 insertions, 0 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 484a6e8..c882b1e 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -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 diff --git a/gcc/builtins.c b/gcc/builtins.c index b4f6186..80f8978 100644 --- a/gcc/builtins.c +++ b/gcc/builtins.c @@ -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, diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 0c4e1a2..bf55581 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,5 +1,10 @@ 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 * gcc.c-torture/20070522-1.c: New testcase. diff --git a/gcc/testsuite/gcc.c-torture/compile/bcopy-1.c b/gcc/testsuite/gcc.c-torture/compile/bcopy-1.c new file mode 100644 index 0000000..5d3a882 --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/bcopy-1.c @@ -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)); +} |
