This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug tree-optimization/22237] [4.0/4.1 Regression] struct copy inlining generates overlapping memcpy
- From: "joseph at codesourcery dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 30 Jun 2005 09:27:45 -0000
- Subject: [Bug tree-optimization/22237] [4.0/4.1 Regression] struct copy inlining generates overlapping memcpy
- References: <20050629231131.22237.jsm28@gcc.gnu.org>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Additional Comments From joseph at codesourcery dot com 2005-06-30 09:27 -------
Subject: Re: [4.0/4.1 Regression] struct copy
inlining generates overlapping memcpy
On Thu, 30 Jun 2005, pinskia at gcc dot gnu dot org wrote:
> I think this is a latent bug as even 3.4 produces calls to memcpy.
Those are memcpy via a stack temporary (each of pq and qp calls memcpy
twice), which is OK. The problem is that 4.0/4.1 use a direct memcpy
between the overlapping structures. Either indirect copying as with 3.4,
or using memmove, would be OK, but you can't just convert
t = s1
s2 = t
into
s2 = s1
if s1 and s2 might overlap.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=22237