Commit dc749759 by Doug Kwan Committed by Doug Kwan

copy7.C: Only abort in memcpy if source and destination are the same.

2008-04-24  Doug Kwan  <dougkwan@google.com>

        * g++.dg/init/copy7.C: Only abort in memcpy if source and
        destination are the same.

From-SVN: r146744
parent 735b94a7
2008-04-24 Doug Kwan <dougkwan@google.com>
* g++.dg/init/copy7.C: Only abort in memcpy if source and
destination are the same.
2009-04-24 Richard Guenther <rguenther@suse.de> 2009-04-24 Richard Guenther <rguenther@suse.de>
* gcc.dg/tree-ssa/vrp48.c: New testcase. * gcc.dg/tree-ssa/vrp48.c: New testcase.
......
...@@ -6,7 +6,14 @@ extern "C" void abort(); ...@@ -6,7 +6,14 @@ extern "C" void abort();
extern "C" void * extern "C" void *
memcpy(void *dest, void *src, __SIZE_TYPE__ n) memcpy(void *dest, void *src, __SIZE_TYPE__ n)
{ {
abort(); if (dest == src)
abort();
else
{
__SIZE_TYPE__ i;
for (i = 0; i < n; i++)
((char *)dest)[i] = ((const char*)src)[i];
}
} }
struct A struct A
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment