From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 6058 invoked by alias); 14 Jun 2002 23:36:03 -0000 Mailing-List: contact gcc-prs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-prs-owner@gcc.gnu.org Received: (qmail 6005 invoked by uid 71); 14 Jun 2002 23:36:01 -0000 Resent-Date: 14 Jun 2002 23:36:00 -0000 Resent-Message-ID: <20020614233600.6004.qmail@sources.redhat.com> Resent-From: gcc-gnats@gcc.gnu.org (GNATS Filer) Resent-To: nobody@gcc.gnu.org Resent-Cc: gcc-prs@gcc.gnu.org, gcc-bugs@gcc.gnu.org Resent-Reply-To: gcc-gnats@gcc.gnu.org, marco@technoboredom.net Received: (qmail 3632 invoked by uid 61); 14 Jun 2002 23:32:30 -0000 Message-Id: <20020614233230.3631.qmail@sources.redhat.com> Date: Fri, 14 Jun 2002 21:56:00 -0000 From: marco@technoboredom.net Reply-To: marco@technoboredom.net To: gcc-gnats@gcc.gnu.org X-Send-Pr-Version: gnatsweb-2.9.3 (1.1.1.1.2.31) Subject: objc/7035: Wrong code in byte-swapping routine generated X-SW-Source: 2002-06/txt/msg00343.txt.bz2 List-Id: >Number: 7035 >Category: objc >Synopsis: Wrong code in byte-swapping routine generated >Confidential: no >Severity: serious >Priority: medium >Responsible: unassigned >State: open >Class: wrong-code >Submitter-Id: net >Arrival-Date: Fri Jun 14 16:36:00 PDT 2002 >Closed-Date: >Last-Modified: >Originator: marco@technoboredom.net >Release: unknown-1.0 >Organization: >Environment: marco@gontscharow:~ > uname -a Linux gontscharow 2.4.4-4GB #1 Sat Jun 23 05:26:59 GMT 2001 i686 unknown marco@gontscharow:~ > gcc -v Reading specs from /usr/lib/gcc-lib/i686-pc-linux-gnu/3.1/specs Configured with: ../gcc-3.1/configure --prefix=/usr --enable-shared --enable-threads=pthreads --enable-languages=ada,c,c++,f77,java,objc : (reconfigured) ../gcc-3.1/configure --prefix=/usr --enable-shared --enable-threads=pthreads --enable-languages=c,c++,f77,java,objc : (reconfigured) ../gcc-3.1/configure --prefix=/usr --enable-shared --enable-threads=posix --enable-languages=c,c++,f77,java,objc Thread model: posix gcc version 3.1 >Description: The Objective-C compiler generates wrong code in GNUstep's byteswapping-routines with the -O2 switch. This is most likely a duplicate to #6834, however I have a shorter testcase (23 lines) here. >How-To-Repeat: marco@gontscharow:~/tmp > gcc -O2 bla.m -o bla marco@gontscharow:~/tmp > ./bla GSU(0)=191 marco@gontscharow:~/tmp > gcc bla.m -o bla marco@gontscharow:~/tmp > ./bla GSU(0)=0 -- The result should be 0 (=byteswap of 0). Compiling this code as a C-programm also returns the correct value, no matter which optimization was selected. >Fix: >Release-Note: >Audit-Trail: >Unformatted: ----gnatsweb-attachment---- Content-Type: application/octet-stream; name="bla.m" Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="bla.m" I2luY2x1ZGUgPHN0ZGlvLmg+Cgp0eXBlZGVmIHVuc2lnbmVkIGludCBnc3UzMjsgCnR5cGVkZWYg dW5zaWduZWQgY2hhciBnc3U4OyAKc3RhdGljIGlubGluZSBnc3UzMgpHU1N3YXBJMzIoZ3N1MzIg aW4pCnsKICB1bmlvbiBzd2FwIHsKICAgIGdzdTMyCW51bTsKICAgIGdzdTgJYnl0WzRdOwogIH0g ZHN0OwogIHVuaW9uIHN3YXAJKnNyYyA9ICh1bmlvbiBzd2FwKikmaW47CiAgZHN0LmJ5dFswXSA9 IHNyYy0+Ynl0WzNdOwogIGRzdC5ieXRbMV0gPSBzcmMtPmJ5dFsyXTsKICBkc3QuYnl0WzJdID0g c3JjLT5ieXRbMV07CiAgZHN0LmJ5dFszXSA9IHNyYy0+Ynl0WzBdOwogIHJldHVybiBkc3QubnVt Owp9CgppbnQgbWFpbigpIAp7CglwcmludGYoIkdTVSgwKT0lZFxuIixHU1N3YXBJMzIoMCkpOwp9 Cg==