From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 19483 invoked by alias); 3 Aug 2002 16:06:00 -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 19465 invoked by uid 71); 3 Aug 2002 16:06:00 -0000 Resent-Date: 3 Aug 2002 16:06:00 -0000 Resent-Message-ID: <20020803160600.19463.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, olivier.baudron@m4x.org Received: (qmail 18811 invoked by uid 61); 3 Aug 2002 15:59:56 -0000 Message-Id: <20020803155956.18810.qmail@sources.redhat.com> Date: Sat, 03 Aug 2002 09:06:00 -0000 From: olivier.baudron@m4x.org Reply-To: olivier.baudron@m4x.org To: gcc-gnats@gcc.gnu.org X-Send-Pr-Version: gnatsweb-2.9.3 (1.1.1.1.2.31) Subject: c/7479: wrong arithmetic output X-SW-Source: 2002-08/txt/msg00052.txt.bz2 List-Id: >Number: 7479 >Category: c >Synopsis: wrong arithmetic output >Confidential: no >Severity: serious >Priority: medium >Responsible: unassigned >State: open >Class: sw-bug >Submitter-Id: net >Arrival-Date: Sat Aug 03 09:06:00 PDT 2002 >Closed-Date: >Last-Modified: >Originator: olivier.baudron@m4x.org >Release: gcc-3.1.1 >Organization: >Environment: >Description: The following testcase produces a wrong output: #include int f() { return 1; } int main(int argc, char **argv) { int n=1, a, b; a = (1 | (2 - f())) | (-n); b = (1 | (2 - 1)) | (-n); printf("a=%d b=%d\n", a, b); return 0; } $ gcc -Wall -o test test.c $ ./test a=1 b=-1 It should be: a=1 b=1 >How-To-Repeat: >Fix: >Release-Note: >Audit-Trail: >Unformatted: