public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "xanclic at gmail dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug middle-end/56888] New: memcpy implementation optimized as a call to memcpy
Date: Mon, 08 Apr 2013 23:40:00 -0000	[thread overview]
Message-ID: <bug-56888-4@http.gcc.gnu.org/bugzilla/> (raw)


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

             Bug #: 56888
           Summary: memcpy implementation optimized as a call to memcpy
    Classification: Unclassified
           Product: gcc
           Version: 4.8.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: middle-end
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: xanclic@gmail.com


Created attachment 29833
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=29833
Naive memcpy implementation

Compiling the attached trivial memcpy implementation with -O3 -ffreestanding
-fno-builtin -nodefaultlibs -nostdlib yields a memcpy which calls itself.
Although the man page explicitly supports this behavior (“The compiler may
generate calls to "memcmp", "memset", "memcpy" and "memmove".”), I find it hard
to write a working compiler-optimized memcpy under these circumstances.
Using -O2 instead of -O3 “fixes” this.

Everything worked for me up until GCC 4.7.3, I'm using Arch Linux, my GCC has
been configured with: /build/src/gcc-4.8.0/configure --prefix=/usr
--libdir=/usr/lib --libexecdir=/usr/lib --mandir=/usr/share/man
--infodir=/usr/share/info --with-bugurl=https://bugs.archlinux.org/
--enable-languages=c,c++,ada,fortran,go,lto,objc,obj-c++ --enable-shared
--enable-threads=posix --with-system-zlib --enable-__cxa_atexit
--disable-libunwind-exceptions --enable-clocale=gnu --disable-libstdcxx-pch
--enable-gnu-unique-object --enable-linker-build-id --enable-cloog-backend=isl
--disable-cloog-version-check --enable-lto --enable-gold --enable-ld=default
--enable-plugin --with-plugin-ld=ld.gold --with-linker-hash-style=gnu
--disable-install-libiberty --enable-multilib --disable-libssp --disable-werror
--enable-checking=release.
>From gcc-bugs-return-419555-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Tue Apr 09 01:14:22 2013
Return-Path: <gcc-bugs-return-419555-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 16310 invoked by alias); 9 Apr 2013 01:14:22 -0000
Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm
Precedence: bulk
List-Id: <gcc-bugs.gcc.gnu.org>
List-Archive: <http://gcc.gnu.org/ml/gcc-bugs/>
List-Post: <mailto:gcc-bugs@gcc.gnu.org>
List-Help: <mailto:gcc-bugs-help@gcc.gnu.org>
Sender: gcc-bugs-owner@gcc.gnu.org
Delivered-To: mailing list gcc-bugs@gcc.gnu.org
Received: (qmail 16246 invoked by uid 48); 9 Apr 2013 01:14:18 -0000
From: "xyqi at marvell dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug target/54338] internal compiler error: in find_costs_and_classes, at ira-costs.c:1711
Date: Tue, 09 Apr 2013 01:14:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: target
X-Bugzilla-Keywords: ice-on-valid-code
X-Bugzilla-Severity: normal
X-Bugzilla-Who: xyqi at marvell dot com
X-Bugzilla-Status: RESOLVED
X-Bugzilla-Priority: P3
X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org
X-Bugzilla-Target-Milestone: ---
X-Bugzilla-Changed-Fields: Status Resolution
Message-ID: <bug-54338-4-EBgXZ2Itld@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-54338-4@http.gcc.gnu.org/bugzilla/>
References: <bug-54338-4@http.gcc.gnu.org/bugzilla/>
X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/
Auto-Submitted: auto-generated
Content-Type: text/plain; charset="UTF-8"
MIME-Version: 1.0
X-SW-Source: 2013-04/txt/msg00700.txt.bz2
Content-length: 770


http://gcc.gnu.org/bugzilla/show_bug.cgi?idT338

Xinyu Qi <xyqi at marvell dot com> changed:

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

--- Comment #5 from Xinyu Qi <xyqi at marvell dot com> 2013-04-09 01:14:16 UTC ---
Fixed by the commit

r197576 | ramana | 2013-04-08 20:19:02 +0800 (Mon, 08 Apr 2013) | 10 lines

Fix PR target/54338 - Include IWMMXT_GR_REGS in ALL_REGS.

For Xinyu Qi.

2013-04-08  Xinyu Qi  <xyqi@marvell.com>

     PR target/54338
     * config/arm/arm.h (REG_CLASS_CONTENTS): Include IWMMXT_GR_REGS
    in ALL_REGS.


             reply	other threads:[~2013-04-08 23:40 UTC|newest]

Thread overview: 40+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-04-08 23:40 xanclic at gmail dot com [this message]
2013-04-09  9:59 ` [Bug middle-end/56888] " mikpe at it dot uu.se
2013-04-09 10:01 ` rguenth at gcc dot gnu.org
2013-04-09 10:01 ` jakub at gcc dot gnu.org
2013-04-09 13:02 ` xanclic at gmail dot com
2013-04-09 13:17 ` rguenther at suse dot de
2013-04-09 13:20 ` xanclic at gmail dot com
2013-04-11 11:29 ` rguenth at gcc dot gnu.org
2013-06-23  0:01 ` jeff@deseret-tech.com
2013-07-17  7:52 ` paulo@matos-sorge.com
2013-07-17 17:10 ` brooks at gcc dot gnu.org
2013-07-17 17:28 ` xanclic at gmail dot com
2013-07-17 20:36 ` schwab@linux-m68k.org
2013-07-17 20:59 ` xanclic at gmail dot com
2013-07-17 22:31 ` schwab@linux-m68k.org
2013-07-18  0:26 ` xanclic at gmail dot com
2013-07-18 10:35 ` paulo@matos-sorge.com
2013-07-28  3:30 ` bugdal at aerifal dot cx
2013-10-02  7:59 ` bernd.edlinger at hotmail dot de
2013-10-02  8:17 ` rguenth at gcc dot gnu.org
2013-10-02  8:49 ` bernd.edlinger at hotmail dot de
2013-10-02  8:59 ` rguenther at suse dot de
2014-02-17  3:48 ` janosch.rux at web dot de
2014-04-29 13:50 ` rguenth at gcc dot gnu.org
2014-04-29 13:57 ` rguenth at gcc dot gnu.org
2014-04-29 14:47 ` bugdal at aerifal dot cx
2014-05-06 10:51 ` rguenth at gcc dot gnu.org
2014-05-06 10:52 ` rguenth at gcc dot gnu.org
2014-06-06 10:40 ` terra at gnome dot org
2014-06-06 11:54 ` rguenther at suse dot de
2014-11-03  7:09 ` fd935653 at opayq dot com
2020-08-16 22:51 ` pinskia at gcc dot gnu.org
2022-06-03  6:55 ` pinskia at gcc dot gnu.org
2022-10-26 17:06 ` pinskia at gcc dot gnu.org
2023-12-18 20:59 ` terra at gnome dot org
2023-12-18 21:32 ` david at westcontrol dot com
2023-12-19  2:07 ` terra at gnome dot org
2023-12-19  8:03 ` rguenth at gcc dot gnu.org
2023-12-19  8:06 ` rguenth at gcc dot gnu.org
2023-12-19  8:28 ` david at westcontrol dot com

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-56888-4@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).