public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug optimization/14593] New: [tree-ssa] bcopy is mysteriously replaced with memcpy
@ 2004-03-16  4:32 kazu at cs dot umass dot edu
  2004-03-16  4:34 ` [Bug optimization/14593] " kazu at cs dot umass dot edu
  2004-03-16  4:43 ` pinskia at gcc dot gnu dot org
  0 siblings, 2 replies; 3+ messages in thread
From: kazu at cs dot umass dot edu @ 2004-03-16  4:32 UTC (permalink / raw)
  To: gcc-bugs

Reduced from gcc.c-torture/execute/builtins/string-asm-2*

typedef __SIZE_TYPE__ size_t;
extern void abort (void);
extern void bcopy (const void *, void *, size_t);

char y[64] = "foX";

void *
memcpy (void *d, const void *s, size_t n)
{
  char *dst = (char *) d;
  const char *src = (const char *) s;
  while (n--)
    *dst++ = *src++;
  return (char *) d;
}

int
main (void)
{
  bcopy (y + 1, y + 2, 3);
  if (y[3] != 'X')
    abort ();

  return 0;
}

With -O0, bcopy stays as is in the final assembly output.
With -O1 and above, bcopy is somehow transformed into memcpy.

This problem seems to occur at expand-time.

On mainline, this problem does not exist.

-- 
           Summary: [tree-ssa] bcopy is mysteriously replaced with memcpy
           Product: gcc
           Version: tree-ssa
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: optimization
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: kazu at cs dot umass dot edu
                CC: gcc-bugs at gcc dot gnu dot org
GCC target triplet: h8300-elf


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14593


^ permalink raw reply	[flat|nested] 3+ messages in thread

* [Bug optimization/14593] [tree-ssa] bcopy is mysteriously replaced with memcpy
  2004-03-16  4:32 [Bug optimization/14593] New: [tree-ssa] bcopy is mysteriously replaced with memcpy kazu at cs dot umass dot edu
@ 2004-03-16  4:34 ` kazu at cs dot umass dot edu
  2004-03-16  4:43 ` pinskia at gcc dot gnu dot org
  1 sibling, 0 replies; 3+ messages in thread
From: kazu at cs dot umass dot edu @ 2004-03-16  4:34 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From kazu at cs dot umass dot edu  2004-03-16 04:34 -------
Note that on this testcase, bcopy must stay as is because
source and destination of bcopy overlap.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14593


^ permalink raw reply	[flat|nested] 3+ messages in thread

* [Bug optimization/14593] [tree-ssa] bcopy is mysteriously replaced with memcpy
  2004-03-16  4:32 [Bug optimization/14593] New: [tree-ssa] bcopy is mysteriously replaced with memcpy kazu at cs dot umass dot edu
  2004-03-16  4:34 ` [Bug optimization/14593] " kazu at cs dot umass dot edu
@ 2004-03-16  4:43 ` pinskia at gcc dot gnu dot org
  1 sibling, 0 replies; 3+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-03-16  4:43 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2004-03-16 04:43 -------
This is an almost exact (very close in fact references the same test case even) dup of bug 14197.

*** This bug has been marked as a duplicate of 14197 ***

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|                            |DUPLICATE


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14593


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2004-03-16  4:43 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-03-16  4:32 [Bug optimization/14593] New: [tree-ssa] bcopy is mysteriously replaced with memcpy kazu at cs dot umass dot edu
2004-03-16  4:34 ` [Bug optimization/14593] " kazu at cs dot umass dot edu
2004-03-16  4:43 ` pinskia at gcc dot gnu dot org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).