public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/12885] New: gcc targetting hppa uses memcpy() with -fno-builtin
@ 2003-11-03 14:02 gcc-bugzilla at gcc dot gnu dot org
  2003-11-03 15:42 ` [Bug c/12885] " falk at debian dot org
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: gcc-bugzilla at gcc dot gnu dot org @ 2003-11-03 14:02 UTC (permalink / raw)
  To: gcc-bugs

PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.

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

           Summary: gcc targetting hppa uses memcpy() with -fno-builtin
           Product: gcc
           Version: 3.2
            Status: UNCONFIRMED
          Severity: critical
          Priority: P2
         Component: c
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: phil at secdev dot org
                CC: gcc-bugs at gcc dot gnu dot org
 GCC build triplet: i386-pc-linux-gnu
  GCC host triplet: i386-pc-linux-gnu
GCC target triplet: hppa-unknown-linux-gnu

When using initialization for variables in the stack, data
must be copied from the .rodata section to the stack.
When the target is hppa, memcpy() is used, even if -fno-builtins is used.

Environment:
System: Linux rigel 2.4.21 #1 Tue Aug 19 13:11:08 CEST 2003 i686 GNU/Linux
Architecture: i686
host: i386-pc-linux-gnu
build: i386-pc-linux-gnu
target: hppa-unknown-linux-gnu
configured with: ../src/configure -v --enable-languages=c --prefix=/usr
--infodir=/usr/share/info --mandir=/usr/share/man
--with-gxx-include-dir=/usr/hppa-linux/include/g++ --enable-shared
--with-gnu-as --with-gnu-ld --with-system-zlib --enable-long-long
--enable-nls --without-included-gettext --disable-checking
--build=i386-linux --host=i386-linux --target=hppa-linux

How-To-Repeat:
$ cat hello.c
int main(void)
{
        char buf[] = "Hello world!\n";
        write(1, buf, sizeof(buf));
}
$ hppa-linux-gcc -S -o - -fno-builtins hello.c
        .LEVEL 1.1
        .section        .rodata
        .align 4
.LC0:
.stringz"Hello world!\n"
        .text
        .align 4
.globl main
                .type            main,@function
main:
        .PROC
        .CALLINFO FRAME=128,CALLS,SAVE_RP,SAVE_SP,ENTRY_GR=3
        .ENTRY
        stw %r2,-20(%r30)
        copy %r3,%r1
        copy %r30,%r3
        stwm %r1,128(%r30)
        ldil LR'.LC0,%r19
        ldo RR'.LC0(%r19),%r19
        ldo 8(%r3),%r20
        ldi 14,%r21
        copy %r20,%r26
        copy %r19,%r25
        copy %r21,%r24
        bl memcpy,%r2  <<<< Here
        nop
        ldi 1,%r26
        ldo 8(%r3),%r25
        ldi 14,%r24
        bl write,%r2
        nop
        ldi 5,%r26
        bl exit,%r2
        nop
        nop
        .EXIT
        .PROCEND
.Lfe1:
        .size   main,.Lfe1-main
        .ident  "GCC: (GNU) 3.2.3 20030221 (Debian prerelease)"
------- Additional Comments From phil at secdev dot org  2003-11-03 14:01 -------
Fix:
??


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

* [Bug c/12885] gcc targetting hppa uses memcpy() with -fno-builtin
  2003-11-03 14:02 [Bug c/12885] New: gcc targetting hppa uses memcpy() with -fno-builtin gcc-bugzilla at gcc dot gnu dot org
@ 2003-11-03 15:42 ` falk at debian dot org
  2003-11-03 15:49 ` pinskia at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: falk at debian dot org @ 2003-11-03 15:42 UTC (permalink / raw)
  To: gcc-bugs

PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.

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


falk at debian dot org changed:

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


------- Additional Comments From falk at debian dot org  2003-11-03 15:42 -------
-fno-builtin is not supposed to suppress generation of libcalls; it just turns
off special recognition of libc functions. You probably want -ffreestanding.


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

* [Bug c/12885] gcc targetting hppa uses memcpy() with -fno-builtin
  2003-11-03 14:02 [Bug c/12885] New: gcc targetting hppa uses memcpy() with -fno-builtin gcc-bugzilla at gcc dot gnu dot org
  2003-11-03 15:42 ` [Bug c/12885] " falk at debian dot org
@ 2003-11-03 15:49 ` pinskia at gcc dot gnu dot org
  2003-11-03 17:45 ` phil at secdev dot org
  2003-11-03 19:17 ` falk at debian dot org
  3 siblings, 0 replies; 5+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2003-11-03 15:49 UTC (permalink / raw)
  To: gcc-bugs

PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.

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


pinskia at gcc dot gnu dot org changed:

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


------- Additional Comments From pinskia at gcc dot gnu dot org  2003-11-03 15:49 -------
But -ffreestanding does not work, at least right on 3.4.


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

* [Bug c/12885] gcc targetting hppa uses memcpy() with -fno-builtin
  2003-11-03 14:02 [Bug c/12885] New: gcc targetting hppa uses memcpy() with -fno-builtin gcc-bugzilla at gcc dot gnu dot org
  2003-11-03 15:42 ` [Bug c/12885] " falk at debian dot org
  2003-11-03 15:49 ` pinskia at gcc dot gnu dot org
@ 2003-11-03 17:45 ` phil at secdev dot org
  2003-11-03 19:17 ` falk at debian dot org
  3 siblings, 0 replies; 5+ messages in thread
From: phil at secdev dot org @ 2003-11-03 17:45 UTC (permalink / raw)
  To: gcc-bugs

PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.

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



------- Additional Comments From phil at secdev dot org  2003-11-03 17:45 -------
Subject: Re:  gcc targetting hppa uses memcpy() with -fno-builtin

yOn 3 Nov 2003, falk at debian dot org wrote:

> PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.
>
> http://gcc.gnu.org/bugzilla/show_bug.cgi?id=12885
>
>
> falk at debian dot org changed:
>
>            What    |Removed                     |Added
> ----------------------------------------------------------------------------
>              Status|UNCONFIRMED                 |RESOLVED
>          Resolution|                            |INVALID
>
>
> ------- Additional Comments From falk at debian dot org  2003-11-03 15:42 -------
> -fno-builtin is not supposed to suppress generation of libcalls; it just turns
> off special recognition of libc functions. You probably want -ffreestanding.
>

You are right. In fact, I use -ffreestanding, which does not work. I
misinterpreted -fno-builtin thinking that it was the misbehaving option.
Please replace any reference to -fno-builtin by -ffreestanding in this
bug report (ie: "gcc targetting hppa uses memcpy() with -ffreestanding").


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

* [Bug c/12885] gcc targetting hppa uses memcpy() with -fno-builtin
  2003-11-03 14:02 [Bug c/12885] New: gcc targetting hppa uses memcpy() with -fno-builtin gcc-bugzilla at gcc dot gnu dot org
                   ` (2 preceding siblings ...)
  2003-11-03 17:45 ` phil at secdev dot org
@ 2003-11-03 19:17 ` falk at debian dot org
  3 siblings, 0 replies; 5+ messages in thread
From: falk at debian dot org @ 2003-11-03 19:17 UTC (permalink / raw)
  To: gcc-bugs

PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.

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


falk at debian dot org changed:

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


------- Additional Comments From falk at debian dot org  2003-11-03 19:17 -------
It turns out that current policy is to emit some function calls even with
-ffreestanding. See bug 4417.


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

end of thread, other threads:[~2003-11-03 19:17 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-11-03 14:02 [Bug c/12885] New: gcc targetting hppa uses memcpy() with -fno-builtin gcc-bugzilla at gcc dot gnu dot org
2003-11-03 15:42 ` [Bug c/12885] " falk at debian dot org
2003-11-03 15:49 ` pinskia at gcc dot gnu dot org
2003-11-03 17:45 ` phil at secdev dot org
2003-11-03 19:17 ` falk at debian 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).