public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
* Re: c/7479: wrong arithmetic output
@ 2002-12-04  5:46 Christian Ehrhardt
  0 siblings, 0 replies; 2+ messages in thread
From: Christian Ehrhardt @ 2002-12-04  5:46 UTC (permalink / raw)
  To: nobody; +Cc: gcc-prs

The following reply was made to PR c/7479; it has been noted by GNATS.

From: "Christian Ehrhardt" <ehrhardt@mathematik.uni-ulm.de>
To: gcc-gnats@gcc.gnu.org, gcc-prs@gcc.gnu.org, olivier.baudron@m4x.org,
  gcc-bugs@gcc.gnu.org, nobody@gcc.gnu.org, jakub@redhat.com
Cc:  
Subject: Re: c/7479: wrong arithmetic output
Date: Wed, 4 Dec 2002 14:44:42 +0100

 http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=7479
 
 Hi,
 
 confirmed on 3.2.1. I tracked this down to a bug in associate_trees that
 is fixed in 3.3. I didn't check the acutal patch but this change log
 entry is quite obviously the fix I'm looking for.
 
 | 2002-08-05  Jakub Jelinek  <jakub@redhat.com>
 | 
 | 	* fold-const.c (associate_trees): Only optimize NEGATE_EXPR in one
 | 	  of the operands into MINUS_EXPR if code is PLUS_EXPR.
 
 Could this go into 3.2.2 and the PR closed afterwards?
 
    regards   Christian
 
 -- 
 THAT'S ALL FOLKS!


^ permalink raw reply	[flat|nested] 2+ messages in thread

* c/7479: wrong arithmetic output
@ 2002-08-03  9:06 olivier.baudron
  0 siblings, 0 replies; 2+ messages in thread
From: olivier.baudron @ 2002-08-03  9:06 UTC (permalink / raw)
  To: gcc-gnats


>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 <stdio.h>
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:


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2002-12-04 13:46 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-12-04  5:46 c/7479: wrong arithmetic output Christian Ehrhardt
  -- strict thread matches above, loose matches on Subject: below --
2002-08-03  9:06 olivier.baudron

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).