[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#299188: marked as done (gcc: -ffreestanding and builtins don't work as expected)



Your message dated Sat, 25 Oct 2008 02:48:47 +0200
with message-id <18690.27887.325179.388843@gargle.gargle.HOWL>
and subject line closing bugs for gcc-3.4, which won't be fixed
has caused the Debian Bug report #299188,
regarding gcc: -ffreestanding and builtins don't work as expected
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact owner@bugs.debian.org
immediately.)


-- 
299188: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=299188
Debian Bug Tracking System
Contact owner@bugs.debian.org with problems
--- Begin Message ---
Package: gcc-3.4
Version: 3.4.3-11
Severity: normal


The info file says:


<--  snip  -->

     With the `-fno-builtin-FUNCTION' option only the built-in function
     FUNCTION is disabled.  FUNCTION must not begin with `__builtin_'.
     If a function is named this is not built-in in this version of
     GCC, this option is ignored.  There is no corresponding
     `-fbuiltin-FUNCTION' option; if you wish to enable built-in
     functions selectively when using `-fno-builtin' or
     `-ffreestanding', you may define macros such as:

          #define abs(n)          __builtin_abs ((n))
          #define strcpy(d, s)    __builtin_strcpy ((d), (s))

<--  snip  -->


But:


<--  snip  -->

$ cat test.c 

#define sprintf __builtin_sprintf

int main()
{
  char str[] = "abc";
  char buf[10];

  sprintf(buf,"%s",str);

  return 0;
}

$ gcc-3.4 -S -ffreestanding -Wall test.c
$ cat test.s
        .file   "test.c"
        .section        .rodata
.LC0:
        .string "abc"
        .text
.globl main
        .type   main, @function
main:
        pushl   %ebp
        movl    %esp, %ebp
        subl    $40, %esp
        andl    $-16, %esp
        movl    $0, %eax
        addl    $15, %eax
        addl    $15, %eax
        shrl    $4, %eax
        sall    $4, %eax
        subl    %eax, %esp
        movl    .LC0, %eax
        movl    %eax, -12(%ebp)
        subl    $8, %esp
        leal    -12(%ebp), %eax
        pushl   %eax
        leal    -40(%ebp), %eax
        pushl   %eax
        call    strcpy
        addl    $16, %esp
        movl    $0, %eax
        leave
        ret
        .size   main, .-main
        .section        .note.GNU-stack,"",@progbits
        .ident  "GCC: (GNU) 3.4.4 20050305 (prerelease) (Debian 3.4.3-11)"
$

<--  snip  -->


As far as I understand the documentation, the call to strcpy
shouldn't be emitted since this function is not required in a
freestanding environment.

gcc-3.3 and gcc-4.0 behave similar.

I'm not sure whether this is expected, but if it is, the documentation
should be updated.



-- System Information:
Debian Release: 3.1
  APT prefers unstable
  APT policy: (500, 'unstable'), (500, 'testing'), (1, 'experimental')
Architecture: i386 (i686)
Kernel: Linux 2.6.11-mm2
Locale: LANG=en_US, LC_CTYPE=en_US (charmap=ISO-8859-1)

Versions of packages gcc-3.4 depends on:
ii  binutils                    2.15-5       The GNU assembler, linker and bina
ii  cpp-3.4                     3.4.3-11     The GNU C preprocessor
ii  gcc-3.4-base                3.4.3-11     The GNU Compiler Collection (base 
ii  libc6                       2.3.2.ds1-20 GNU C Library: Shared libraries an
ii  libgcc1                     1:4.0-0pre5  GCC support library

-- no debconf information


--- End Message ---
--- Begin Message ---
tag 471831 + wontfix
tag 441104 + wontfix
tag 452115 + wontfix
tag 299188 + wontfix
tag 420533 + wontfix
tag 437537 + wontfix
tag 378107 + wontfix
tag 425053 + wontfix
tag 323285 + wontfix
tag 399100 + wontfix
thanks

closing bugs for gcc-3.4, which won't be fixed. either the binary
package is not built anymore in unstable, or we will not fix this in
3.4.



--- End Message ---

Reply to: