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: Janis Johnson <janis187 at us dot ibm dot com>
- To: gcc-gnats at gcc dot gnu dot org, gcc-prs at gcc dot gnu dot org, duchier at ps dot uni-sb dot de, gcc-bugs at gcc dot gnu dot org, nobody at gcc dot gnu dot org
- Date: Mon, 23 Dec 2002 16:37:21 -0800
- Subject: Re: optimization/8634: [3.2/3.3 regression] incorrect code for inlining of memcpy under -O2
- Organization: IBM
- Reply-to: janis187 at us dot ibm dot com
The regression reported in PR optimization/8634 showed up
starting with this patch (strange but true):
Fri Dec 21 23:30:14 CET 2001 Jan Hubicka <jh@suse.cz>
* i386.h (TARGET_CPU_DEFAULT_pentium_mmx): New.
(TARGET_CPU_DEFAULT_*): Renumber.
I used this test case that Wolfgang provided. It aborts
when the wrong code is generated for -O2 on i686-linux:
--------------
/* incorrect code for inlining of memcpy under -O2 */
#include <string.h>
#include <stdlib.h>
int
main ()
{
int i;
char buffer[8];
const char head[8] =
{ 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H' };
memcpy (buffer, head, 8);
for (i = 0; i < 8; i++)
if (head[i] != buffer[i])
abort ();
return 0;
}
--------------
http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=8634