public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug middle-end/30028]  New: [4.3 Regression] bcopy is wrongly converted to memcpy
@ 2006-11-30 12:19 kkojima at gcc dot gnu dot org
  2006-11-30 13:52 ` [Bug middle-end/30028] " rguenth at gcc dot gnu dot org
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: kkojima at gcc dot gnu dot org @ 2006-11-30 12:19 UTC (permalink / raw)
  To: gcc-bugs

gcc.c-torture/execute/builtins/memops-asm.c fails on sh-elf
with -O1 and higher.  It seems that bcopy is converted to memcpy
even when source and destination area are overlapped.  It looks
same tests start to fail also on ia64 and s390 testresults.  They
don't fail on i686, but a similar testcase

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

char y[64] = "foXXXrfoobar";

int
main ()
{
  bcopy (y + 1, y + 2, 6);
  if (memcmp (y, "fooXXXrfobar", 13))
    abort ();
  return 0;
}

aborts with -O1 on i686-pc-linux-gnu for revision 119302.
If the resent changes of builtins.c in r119292 and r119294 are
reverted, the errors go away.


-- 
           Summary: [4.3 Regression] bcopy is wrongly converted to memcpy
           Product: gcc
           Version: 4.3.0
            Status: UNCONFIRMED
          Keywords: wrong-code
          Severity: normal
          Priority: P3
         Component: middle-end
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: kkojima at gcc dot gnu dot org
 GCC build triplet: i686-pc-linux-gnu
  GCC host triplet: i686-pc-linux-gnu
GCC target triplet: sh-elf


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


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

* [Bug middle-end/30028] [4.3 Regression] bcopy is wrongly converted to memcpy
  2006-11-30 12:19 [Bug middle-end/30028] New: [4.3 Regression] bcopy is wrongly converted to memcpy kkojima at gcc dot gnu dot org
@ 2006-11-30 13:52 ` rguenth at gcc dot gnu dot org
  2006-11-30 14:11 ` hubicka at ucw dot cz
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2006-11-30 13:52 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from rguenth at gcc dot gnu dot org  2006-11-30 13:52 -------
This is honza again.


-- 

rguenth at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |hubicka at gcc dot gnu dot
                   |                            |org


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


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

* [Bug middle-end/30028] [4.3 Regression] bcopy is wrongly converted to memcpy
  2006-11-30 12:19 [Bug middle-end/30028] New: [4.3 Regression] bcopy is wrongly converted to memcpy kkojima at gcc dot gnu dot org
  2006-11-30 13:52 ` [Bug middle-end/30028] " rguenth at gcc dot gnu dot org
@ 2006-11-30 14:11 ` hubicka at ucw dot cz
  2006-11-30 18:14 ` pinskia at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: hubicka at ucw dot cz @ 2006-11-30 14:11 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from hubicka at ucw dot cz  2006-11-30 14:11 -------
Subject: Re:  [4.3 Regression] bcopy is wrongly converted to memcpy

Hi,
there is nice typo on the check validating the transformation.  I am
testing the patch and will commit it as obvious if it passes.

Honza

Index: builtins.c
===================================================================
--- builtins.c  (revision 119360)
+++ builtins.c  (working copy)
@@ -8176,7 +8176,7 @@ fold_builtin_memory_op (tree arglist, tr
          if (dest_align && src_align
              && (readonly_data_expr (src)
                  || (host_integerp (len, 1)
-                     && (MIN (src_align, dest_align) / BITS_PER_UNIT <=
+                     && (MIN (src_align, dest_align) / BITS_PER_UNIT >=
                          tree_low_cst (len, 1)))))
            {
              tree fn = implicit_built_in_decls[BUILT_IN_MEMCPY];


-- 


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


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

* [Bug middle-end/30028] [4.3 Regression] bcopy is wrongly converted to memcpy
  2006-11-30 12:19 [Bug middle-end/30028] New: [4.3 Regression] bcopy is wrongly converted to memcpy kkojima at gcc dot gnu dot org
  2006-11-30 13:52 ` [Bug middle-end/30028] " rguenth at gcc dot gnu dot org
  2006-11-30 14:11 ` hubicka at ucw dot cz
@ 2006-11-30 18:14 ` pinskia at gcc dot gnu dot org
  2006-11-30 19:36 ` hubicka at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2006-11-30 18:14 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from pinskia at gcc dot gnu dot org  2006-11-30 18:14 -------
This also fails for spu-elf.
Confirmed.
http://gcc.gnu.org/ml/gcc-testresults/2006-11/msg01291.html


-- 

pinskia at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|0                           |1
  GCC build triplet|i686-pc-linux-gnu           |
   GCC host triplet|i686-pc-linux-gnu           |
 GCC target triplet|sh-elf                      |sh-elf, spu-elf
   Last reconfirmed|0000-00-00 00:00:00         |2006-11-30 18:14:15
               date|                            |
   Target Milestone|---                         |4.3.0


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


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

* [Bug middle-end/30028] [4.3 Regression] bcopy is wrongly converted to memcpy
  2006-11-30 12:19 [Bug middle-end/30028] New: [4.3 Regression] bcopy is wrongly converted to memcpy kkojima at gcc dot gnu dot org
                   ` (2 preceding siblings ...)
  2006-11-30 18:14 ` pinskia at gcc dot gnu dot org
@ 2006-11-30 19:36 ` hubicka at gcc dot gnu dot org
  2006-12-01  3:51 ` pinskia at gcc dot gnu dot org
  2006-12-07 18:25 ` patchapp at dberlin dot org
  5 siblings, 0 replies; 7+ messages in thread
From: hubicka at gcc dot gnu dot org @ 2006-11-30 19:36 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #4 from hubicka at gcc dot gnu dot org  2006-11-30 19:36 -------
Subject: Bug 30028

Author: hubicka
Date: Thu Nov 30 19:36:02 2006
New Revision: 119375

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=119375
Log:
        PR middle-end/30028
        * builtins.c (fold_builtin_memory_op): Fix typo in the check for
        memmove/bcopy->memcpy conversion.

Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/builtins.c


-- 


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


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

* [Bug middle-end/30028] [4.3 Regression] bcopy is wrongly converted to memcpy
  2006-11-30 12:19 [Bug middle-end/30028] New: [4.3 Regression] bcopy is wrongly converted to memcpy kkojima at gcc dot gnu dot org
                   ` (3 preceding siblings ...)
  2006-11-30 19:36 ` hubicka at gcc dot gnu dot org
@ 2006-12-01  3:51 ` pinskia at gcc dot gnu dot org
  2006-12-07 18:25 ` patchapp at dberlin dot org
  5 siblings, 0 replies; 7+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2006-12-01  3:51 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #5 from pinskia at gcc dot gnu dot org  2006-12-01 03:51 -------
Confirmed fixed.


-- 

pinskia at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED


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


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

* [Bug middle-end/30028] [4.3 Regression] bcopy is wrongly converted to memcpy
  2006-11-30 12:19 [Bug middle-end/30028] New: [4.3 Regression] bcopy is wrongly converted to memcpy kkojima at gcc dot gnu dot org
                   ` (4 preceding siblings ...)
  2006-12-01  3:51 ` pinskia at gcc dot gnu dot org
@ 2006-12-07 18:25 ` patchapp at dberlin dot org
  5 siblings, 0 replies; 7+ messages in thread
From: patchapp at dberlin dot org @ 2006-12-07 18:25 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #6 from patchapp at dberlin dot org  2006-12-07 18:25 -------
Subject: Bug number PR30028

A patch for this bug has been added to the patch tracker.
The mailing list url for the patch is
http://gcc.gnu.org/ml/gcc-patches/2006-12/msg00499.html


-- 


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


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

end of thread, other threads:[~2006-12-07 18:25 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-11-30 12:19 [Bug middle-end/30028] New: [4.3 Regression] bcopy is wrongly converted to memcpy kkojima at gcc dot gnu dot org
2006-11-30 13:52 ` [Bug middle-end/30028] " rguenth at gcc dot gnu dot org
2006-11-30 14:11 ` hubicka at ucw dot cz
2006-11-30 18:14 ` pinskia at gcc dot gnu dot org
2006-11-30 19:36 ` hubicka at gcc dot gnu dot org
2006-12-01  3:51 ` pinskia at gcc dot gnu dot org
2006-12-07 18:25 ` patchapp at dberlin 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).