public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "bunk at stusta dot de" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c/34027]  New: [4.3 regression] -Os code size nearly doubled
Date: Thu, 08 Nov 2007 11:39:00 -0000	[thread overview]
Message-ID: <bug-34027-9876@http.gcc.gnu.org/bugzilla/> (raw)

PR32044 makes it for months impossible to compile the Linux kernel with gcc
4.3, but I'll leave the discussions who's technically at fault (and whether gcc
4.3 will ever be able to compile the Linux kernel) to the people who know more
about such things.

But the fact that the code emitted with -Os used is nearly twice as big that's
a  regression in gcc.

Test case:

$ cat test.c
unsigned long long foobar(unsigned long long ns)
{
  while(ns >= 1000000000L)
    ns -= 1000000000L;
  return ns;
}
$ gcc --version
gcc (GCC) 4.2.3 20071014 (prerelease) (Debian 4.2.2-3)
...
$ gcc -Os test.c -c -o old-gcc.o
$ /usr/local/DIR/gcc-svn20071108/bin/gcc -Os test.c -c -o new-gcc.o
$ objdump -D old-gcc.o 

old-gcc.o:     file format elf32-i386

Disassembly of section .text:

00000000 <foobar>:
   0:   55                      push   %ebp
   1:   89 e5                   mov    %esp,%ebp
   3:   8b 45 08                mov    0x8(%ebp),%eax
   6:   8b 55 0c                mov    0xc(%ebp),%edx
   9:   eb 08                   jmp    13 <foobar+0x13>
   b:   05 00 36 65 c4          add    $0xc4653600,%eax
  10:   83 d2 ff                adc    $0xffffffff,%edx
  13:   83 fa 00                cmp    $0x0,%edx
  16:   77 f3                   ja     b <foobar+0xb>
  18:   3d ff c9 9a 3b          cmp    $0x3b9ac9ff,%eax
  1d:   77 ec                   ja     b <foobar+0xb>
  1f:   5d                      pop    %ebp
  20:   c3                      ret    
Disassembly of section .comment:
...
$ objdump -D new-gcc.o 

new-gcc.o:     file format elf32-i386

Disassembly of section .text:

00000000 <foobar>:
   0:   55                      push   %ebp
   1:   89 e5                   mov    %esp,%ebp
   3:   57                      push   %edi
   4:   56                      push   %esi
   5:   53                      push   %ebx
   6:   bb 00 36 65 c4          mov    $0xc4653600,%ebx
   b:   83 ec 0c                sub    $0xc,%esp
   e:   8b 7d 0c                mov    0xc(%ebp),%edi
  11:   8b 75 08                mov    0x8(%ebp),%esi
  14:   6a 00                   push   $0x0
  16:   68 00 ca 9a 3b          push   $0x3b9aca00
  1b:   57                      push   %edi
  1c:   56                      push   %esi
  1d:   e8 fc ff ff ff          call   1e <foobar+0x1e>
  22:   83 c4 10                add    $0x10,%esp
  25:   69 ca 00 36 65 c4       imul   $0xc4653600,%edx,%ecx
  2b:   29 c1                   sub    %eax,%ecx
  2d:   f7 e3                   mul    %ebx
  2f:   01 f0                   add    %esi,%eax
  31:   8d 14 11                lea    (%ecx,%edx,1),%edx
  34:   11 fa                   adc    %edi,%edx
  36:   8d 65 f4                lea    -0xc(%ebp),%esp
  39:   5b                      pop    %ebx
  3a:   5e                      pop    %esi
  3b:   5f                      pop    %edi
  3c:   5d                      pop    %ebp
  3d:   c3                      ret    
Disassembly of section .comment:
...
$


-- 
           Summary: [4.3 regression] -Os code size nearly doubled
           Product: gcc
           Version: 4.3.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: bunk at stusta dot de
 GCC build triplet: i686-pc-linux-gnu
  GCC host triplet: i686-pc-linux-gnu
GCC target triplet: i686-pc-linux-gnu


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


             reply	other threads:[~2007-11-08 11:39 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-11-08 11:39 bunk at stusta dot de [this message]
2007-11-08 21:45 ` [Bug tree-optimization/34027] " rguenth at gcc dot gnu dot org
2007-11-09 12:15 ` jakub at gcc dot gnu dot org
2007-11-09 12:20 ` rguenther at suse dot de
2007-11-09 12:30 ` jakub at gcc dot gnu dot org
2007-11-09 12:37 ` rguenther at suse dot de
2007-11-10  7:58 ` bunk at stusta dot de
2007-11-10 23:54 ` rguenth at gcc dot gnu dot org
2007-11-12 13:24 ` rguenth at gcc dot gnu dot org
2007-11-12 13:28 ` rguenth at gcc dot gnu dot org
2007-11-12 15:01 ` rguenth at gcc dot gnu dot org

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-34027-9876@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).