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

Bug#452431: marked as done (g++-4.2: two cases of bad optimization in x86 (i686) with long long in 32bit)



Your message dated Tue, 23 Jun 2015 07:24:48 +0000
with message-id <E1Z7IZc-0001tY-Ii@franck.debian.org>
and subject line Bug#789156: Removed package(s) from unstable
has caused the Debian Bug report #452431,
regarding g++-4.2: two cases of bad optimization in x86 (i686) with long long in 32bit
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.)


-- 
452431: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=452431
Debian Bug Tracking System
Contact owner@bugs.debian.org with problems
--- Begin Message ---
Package: g++-4.2
Version: 4.2.2-3
Severity: minor


the following snippet of code shows two cases of bad optimization
behaviour on gcc 4.1.3 and 4.2.3 (debian unstable).



#define PTS_MASK ((1LL << 33)-1)
#define PTS_WRAP (1LL << 33)
#define PTS_WRAP2 (1LL << 32)

long long ptsdiff_mod2_33(long long a, long long b) {
  long long d = (b + PTS_WRAP - a) & PTS_MASK;
  return (d >= PTS_WRAP2) ? d - PTS_WRAP : d;
}



the following assembler code is generated:



        .file   "test4.cpp"
        .text
        .align 2
        .p2align 4,,15
.globl _Z15ptsdiff_mod2_33xx
        .type   _Z15ptsdiff_mod2_33xx, @function
_Z15ptsdiff_mod2_33xx:
.LFB2:
        pushl   %ebp
.LCFI0:
        movl    %esp, %ebp
.LCFI1:
        movl    16(%ebp), %eax
        movl    20(%ebp), %edx
        pushl   %ebx
.LCFI2:
        addl    $0, %eax
        adcl    $2, %edx
        subl    8(%ebp), %eax
        sbbl    12(%ebp), %edx
        movl    %eax, %ecx
        movl    %edx, %ebx
        andl    $1, %ebx
        cmpl    $0, %ebx
        jl      .L2
        jle     .L2
        addl    $0, %ecx
        adcl    $-2, %ebx
.L2:
        movl    %ebx, %edx
        movl    %ecx, %eax
        popl    %ebx
        popl    %ebp
        ret
.LFE2:
        .size   _Z15ptsdiff_mod2_33xx, .-_Z15ptsdiff_mod2_33xx
.globl __gxx_personality_v0
        .ident  "GCC: (GNU) 4.1.3 20071019 (prerelease) (Debian 4.1.2-17)"
        .section        .note.GNU-stack,"",@progbits



two obvious optimization faults:

1) addl $0, reg   is totally pointless

2) jl label   followed by   jle label   is equivalent to just   jle label


i reported that bug too to gcc, but their mailer blocked the mail.


-- System Information:
Debian Release: lenny/sid
  APT prefers unstable
  APT policy: (500, 'unstable')
Architecture: i386 (i686)

Kernel: Linux 2.6.23.1 (PREEMPT)
Locale: LANG=de_DE.UTF-8@euro, LC_CTYPE=de_DE.UTF-8@euro (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash

Versions of packages g++-4.2 depends on:
ii  gcc-4.2                       4.2.2-3    The GNU C compiler
ii  gcc-4.2-base                  4.2.2-3    The GNU Compiler Collection
(base
ii  libc6                         2.6.1-6    GNU C Library: Shared libraries
ii  libstdc++6-4.2-dev            4.2.2-3    The GNU Standard C++
Library v3 (d

g++-4.2 recommends no packages.

-- no debconf information




--- End Message ---
--- Begin Message ---
Version: 4.7.4-3+rm

Dear submitter,

as the package gcc-4.7 has just been removed from the Debian archive
unstable we hereby close the associated bug reports.  We are sorry
that we couldn't deal with your issue properly.

For details on the removal, please see https://bugs.debian.org/789156

The version of this package that was in Debian prior to this removal
can still be found using http://snapshot.debian.org/.

This message was generated automatically; if you believe that there is
a problem with it please contact the archive administrators by mailing
ftpmaster@ftp-master.debian.org.

Debian distribution maintenance software
pp.
Luca Falavigna (the ftpmaster behind the curtain)

--- End Message ---

Reply to: