This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: optimization/8634: [3.2/3.3 regression] incorrect code for inlining of memcpy under -O2
- From: bangerth at dealii dot org
- To: duchier at ps dot uni-sb dot de, gcc-bugs at gcc dot gnu dot org, gcc-prs at gcc dot gnu dot org, nobody at gcc dot gnu dot org
- Date: 4 Dec 2002 22:31:58 -0000
- Subject: Re: optimization/8634: [3.2/3.3 regression] incorrect code for inlining of memcpy under -O2
- Reply-to: bangerth at dealii dot org, duchier at ps dot uni-sb dot de, gcc-bugs at gcc dot gnu dot org, gcc-prs at gcc dot gnu dot org, nobody at gcc dot gnu dot org, gcc-gnats at gcc dot gnu dot org
Old Synopsis: incorrect inlining of memcpy under -O2
New Synopsis: [3.2/3.3 regression] incorrect code for inlining of memcpy under -O2
State-Changed-From-To: open->analyzed
State-Changed-By: bangerth
State-Changed-When: Wed Dec 4 14:31:57 2002
State-Changed-Why:
Confirmed. This program
----------------------------
#include <stdio.h>
#include <string.h>
int main()
{
char* buffer = new char[8];
const char head[8] = {
'A', 'B', 'C', 'D',
'E', 'F', 'G', 'H'
};
memcpy(buffer,head,8);
for(int i=0;i<8;i++)
printf ("[%u] = %c, %c\n", i, head[i], buffer[i]);
return 0;
}
--------------------------------
yields with 3.2.2pre, 3.3pre, and 2.95 respectively:
tmp/g> /home/bangerth/bin/gcc-3.2.2-pre/bin/c++ -O2 bug.cc && ./a.out
[0] = A, A
[1] = B,
[2] = C,
[3] = D,
[4] = E, E
[5] = F, F
[6] = G, G
[7] = H, H
tmp/g> /home/bangerth/bin/gcc-3.3-pre/bin/c++ -O2 bug.cc && ./a.out
[0] = A, A
[1] = B,
[2] = C,
[3] = D,
[4] = E, E
[5] = F, F
[6] = G, G
[7] = H, H
tmp/g> c++ -O2 bug.cc && ./a.out
[0] = A, A
[1] = B, B
[2] = C, C
[3] = D, D
[4] = E, E
[5] = F, F
[6] = G, G
[7] = H, H
That seems like a regression.
http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=8634