From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 3192 invoked by alias); 28 Jun 2002 09:46:10 -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 3134 invoked by uid 71); 28 Jun 2002 09:46:06 -0000 Resent-Date: 28 Jun 2002 09:46:06 -0000 Resent-Message-ID: <20020628094606.3133.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, Ben Liblit Received: (qmail 2915 invoked from network); 28 Jun 2002 09:45:14 -0000 Received: from unknown (HELO brawnix.CS.Berkeley.EDU) (128.32.131.103) by sources.redhat.com with SMTP; 28 Jun 2002 09:45:14 -0000 Received: (from liblit@localhost) by brawnix.CS.Berkeley.EDU (8.11.6/8.11.6) id g5S9jE325314; Fri, 28 Jun 2002 02:45:14 -0700 Message-Id: <200206280945.g5S9jE325314@brawnix.CS.Berkeley.EDU> Date: Fri, 28 Jun 2002 04:16:00 -0000 From: Ben Liblit To: gcc-gnats@gcc.gnu.org X-Send-Pr-Version: 3.113 Subject: c/7153: bad operands for 'movsbl' error X-SW-Source: 2002-06/txt/msg00691.txt.bz2 List-Id: >Number: 7153 >Category: c >Synopsis: bad operands for 'movsbl' error >Confidential: no >Severity: serious >Priority: medium >Responsible: unassigned >State: open >Class: rejects-legal >Submitter-Id: net >Arrival-Date: Fri Jun 28 02:46:05 PDT 2002 >Closed-Date: >Last-Modified: >Originator: Ben Liblit >Release: 3.1 >Organization: Computer Science Division, UC Berkeley >Environment: System: Linux brawnix.CS.Berkeley.EDU 2.4.18 #6 Wed Jun 12 02:01:38 PDT 2002 i686 unknown Architecture: i686 host: i686-pc-linux-gnu build: i686-pc-linux-gnu target: i686-pc-linux-gnu configured with: ../gcc-3.1/configure --prefix=/var/local/gcc/install >Description: When fed the C source file given below, gcc generates assembly code which yields the following error message: /var/tmp/ccKc5NSG.s:14: Error: suffix or operands invalid for `movsbl' The assembly code on the line in question is: movsbl %ebx,%eax I don't know enough about x86 assembly code to know whether that is correct (asm bug) or incorrect (gcc bug), but something somewhere is broken. Important note: the error only appears when compiling with optimization level 2 or higher (-O2). Below that, the code compiles correctly. Although I am reporting this as a bug in gcc-3.1, I have reproduced the same problem in 2.96 and 3.0. On the off chance that this is an assembler bug, I'm using as-2.11.93.0.2. >How-To-Repeat: Compile the following code using "gcc -O2 -c bug.c": void f(char); void g(); void scale() { int width; char bytes; char *src; if (width) { bytes = *src; g(); width *= bytes; } f(bytes); } I am aware that this code doesn't exactly do anything useful, and even accesses uninitialized variables. This fragment is a minimized excerpt from the thousand-line source file in which I originally encountered the bug. >Fix: >Release-Note: >Audit-Trail: >Unformatted: