From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 25599 invoked by alias); 9 May 2003 20:36:01 -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 25555 invoked by uid 71); 9 May 2003 20:36:01 -0000 Resent-Date: 9 May 2003 20:36:01 -0000 Resent-Message-ID: <20030509203601.25554.qmail@sources.redhat.com> Resent-From: gcc-gnats@gcc.gnu.org (GNATS Filer) Resent-Cc: gcc-prs@gcc.gnu.org, gcc-bugs@gcc.gnu.org Resent-Reply-To: gcc-gnats@gcc.gnu.org, sb@biallas.net Received: (qmail 20483 invoked by uid 48); 9 May 2003 20:34:01 -0000 Message-Id: <20030509203401.20482.qmail@sources.redhat.com> Date: Fri, 09 May 2003 20:36:00 -0000 From: sb@biallas.net Reply-To: sb@biallas.net To: gcc-gnats@gcc.gnu.org X-Send-Pr-Version: gnatsweb-2.9.3 (1.1.1.1.2.31) Subject: c/10719: invalid code generated (x86, "int $5") with __builtin_va_arg(va, char); X-SW-Source: 2003-05/txt/msg00831.txt.bz2 List-Id: >Number: 10719 >Category: c >Synopsis: invalid code generated (x86, "int $5") with __builtin_va_arg(va, char); >Confidential: no >Severity: serious >Priority: medium >Responsible: unassigned >State: open >Class: sw-bug >Submitter-Id: net >Arrival-Date: Fri May 09 20:36:01 UTC 2003 >Closed-Date: >Last-Modified: >Originator: sb@biallas.net >Release: gcc version 3.2.3 20030422 (Gentoo Linux 1.4 3.2.3, propolice) >Organization: >Environment: Gentoo Linux 1.4 x86 >Description: When using char b = __builtin_va_arg(va, char); gcc incorrectly generates an "int $5" in assembly (x86). (I know, that this is bad code and I should use "int" instead of "char) Extract from disassembly: [...] pushl %ebp movl %esp, %ebp subl $8, %esp leal 12(%ebp), %eax movl %eax, -4(%ebp) int $5 [...] This is obviously plain wrong. This is reproduceable with versions 3.2.2 and 3.2.3 but not with 3.2.1 >How-To-Repeat: run gcc -S -o cuda.s cuda.i >Fix: >Release-Note: >Audit-Trail: >Unformatted: ----gnatsweb-attachment---- Content-Type: application/octet-stream; name="cuda.i" Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="cuda.i" dHlwZWRlZiBfX2J1aWx0aW5fdmFfbGlzdCBfX2dudWNfdmFfbGlzdDsKdHlwZWRlZiBfX2dudWNf dmFfbGlzdCB2YV9saXN0OwoKdm9pZCBpbnQ1KGludCBuYiwgLi4uKQp7CiAgICAgICAgdmFfbGlz dCB2YTsKICAgICAgICBfX2J1aWx0aW5fc3RkYXJnX3N0YXJ0KCh2YSksbmIpOwogICAgICAgIGNo YXIgYiA9IF9fYnVpbHRpbl92YV9hcmcodmEsIGNoYXIpOwogICAgICAgIF9fYnVpbHRpbl92YV9l bmQodmEpOwp9Cg==