This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: optimization/8634: [3.2/3.3 regression] incorrect code for inlining of memcpy under -O2


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




Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]