Your message dated 29 Aug 2008 13:02:57 -0400
with message-id <[EMAIL PROTECTED]>
and subject line closing bug report
has caused the Debian Bug report #496965,
regarding g++-4.3-multilib: Bad code generation for enum switch -m32
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 [EMAIL PROTECTED]
immediately.)


-- 
496965: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=496965
Debian Bug Tracking System
Contact [EMAIL PROTECTED] with problems
--- Begin Message ---
Package: g++-4.3-multilib
Version: 4.3.1-9
Severity: important

g++ generates bad code for this program.  It works with fine in 64-bit and
with older versions of gcc.  I chose severity important because it is a silent
bad code generation, and it was working fine with previous versions of gcc (feel free to downgrade it though)

#include <stdlib.h>
struct MyTypes {
    enum Type {
        NOVALUE = 1,
        VALUE   = 30,
        VALUE2 = 31,
        VALUE3 = -3
    };

    static bool isValue(MyTypes::Type value);
};

bool MyTypes::isValue(MyTypes::Type value)
{
    switch (value) {
      case MyTypes::VALUE:
      case MyTypes::VALUE2:
      case MyTypes::VALUE3: {
        return true;
      }
      default: {
        return false;
      }
    }
}

int main(int argc, char *argv[])
{
    if (true == MyTypes::isValue(MyTypes::Type(32))) {
        abort();
    }
    return 0;
}

[EMAIL PROTECTED]:~$ g++ -m32 -Wall -o e enumtest.cpp
[EMAIL PROTECTED]:~$ ./e
Aborted
[EMAIL PROTECTED]:~$ g++ -Wall -o e enumtest.cpp
[EMAIL PROTECTED]:~$ ./e
[EMAIL PROTECTED]:~$ g++-4.2 -m32 -Wall -o e enumtest.cpp
[EMAIL PROTECTED]:~$ ./e
[EMAIL PROTECTED]:~$ g++-4.1 -m32 -Wall -o e enumtest.cpp
[EMAIL PROTECTED]:~$ ./e

It works with -O2 though (not -O1):
[EMAIL PROTECTED]:~$ g++ -O2 -m32 -Wall -o e enumtest.cpp
[EMAIL PROTECTED]:~$ ./e


-- System Information:
Debian Release: lenny/sid
  APT prefers testing
  APT policy: (990, 'testing'), (500, 'unstable')
Architecture: amd64 (x86_64)

Kernel: Linux 2.6.26-1-amd64 (SMP w/2 CPU cores)
Locale: LANG=en_US.ISO-8859-15, LC_CTYPE=en_US.ISO-8859-15 (charmap=ISO-8859-15)
Shell: /bin/sh linked to /bin/bash

Versions of packages g++-4.3-multilib depends on:
ii  g++-4.3                       4.3.1-9    The GNU C++ compiler
ii  gcc-4.3-base                  4.3.1-9    The GNU Compiler Collection (base
ii gcc-4.3-multilib 4.3.1-9 The GNU C compiler (multilib files ii lib32stdc++6 4.3.1-9 The GNU Standard C++ Library v3 (3

g++-4.3-multilib recommends no packages.

Versions of packages g++-4.3-multilib suggests:
ii lib32stdc++6-4.3-dbg 4.3.1-9 The GNU Standard C++ Library v3 (d

-- no debconf information


--
Guillaume Morin <[EMAIL PROTECTED]>

----------------------------------------------------------------
This message was sent using IMP, the Internet Messaging Program.




--- End Message ---
--- Begin Message ---
Gcc is actually correct.  The behavior of this program is undefined.  Closing.

--- End Message ---

Reply via email to