User account creation filtered due to spam.

Bug 6981 - wrong code in 64-bit manipulation on x86
Summary: wrong code in 64-bit manipulation on x86
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: target (show other bugs)
Version: 3.1
: P1 critical
Target Milestone: ---
Assignee: Jakub Jelinek
URL:
Keywords: wrong-code
Depends on:
Blocks:
 
Reported: 2002-06-10 02:56 UTC by Mattias Engdegård
Modified: 2003-07-25 17:33 UTC (History)
3 users (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed:


Attachments
sr1.c (266 bytes, application/octet-stream)
2003-05-21 15:17 UTC, Mattias Engdegård
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Mattias Engdegård 2002-06-10 02:56:00 UTC
gcc 3.1 (x86 target) generates wrong code when the attached
file is compiled with -O2. The error is in the bar() function.
The attach file also serves as a testcase, returning 0 if
the bug is present, 1 otherwise.

(What makes the problem severe is that the wrong code is
generated silently and the exact circumstances unknown, so
we are going back to 3.0.4 meanwhile.)

Release:
3.1

Environment:
redhat 6.2 host (x86)

How-To-Repeat:
Compile the attached file with -O2, using plain gcc 3.1 for
x86, built from source with a default configuration.
Comment 1 Mattias Engdegård 2002-06-10 02:56:00 UTC
Fix:
Use a lower optimisation level than -O2
Comment 2 Mattias Engdegård 2002-07-16 15:54:24 UTC
From: "=?ISO-8859-1?Q?Mattias Engdeg=E5rd?=" <mattias@virtutech.se>
To: gcc-gnats@gcc.gnu.org, gcc-prs@gcc.gnu.org, gcc-bugs@gcc.gnu.org
Cc:  
Subject: Re: target/6981: wrong code in 64-bit manipulation on x86
Date: Tue, 16 Jul 2002 15:54:24 +0200

 I should make it clear that this is a regression from gcc 3.0.x, so someone
 may want to elevate the priority.
 

Comment 3 Mattias Engdegård 2002-07-25 17:00:23 UTC
From: "=?ISO-8859-1?Q?Mattias Engdeg=E5rd?=" <mattias@virtutech.se>
To: gcc-gnats@gcc.gnu.org
Cc:  
Subject: target/6981: wrong code in 64-bit manipulation on x86
Date: Thu, 25 Jul 2002 17:00:23 +0200

 >The attach file also serves as a testcase, returning 0 if
 >the bug is present, 1 otherwise.
 
 No, it is the other way around.
 
Comment 4 Jakub Jelinek 2002-07-26 08:26:15 UTC
Responsible-Changed-From-To: unassigned->jakub
Responsible-Changed-Why: Confirmed, debugging...
Comment 5 Nathanael C. Nerode 2002-10-24 12:00:18 UTC
State-Changed-From-To: open->closed
State-Changed-Why: Fixed on both mainline and 3.2.
Comment 6 Jakub Jelinek 2002-10-24 17:11:57 UTC
From: jakub@gcc.gnu.org
To: gcc-gnats@gcc.gnu.org
Cc:  
Subject: target/6981
Date: 24 Oct 2002 17:11:57 -0000

 CVSROOT:	/cvs/gcc
 Module name:	egcs
 Branch: 	gcc-3_2-branch
 Changes by:	jakub@gcc.gnu.org	2002-10-24 10:11:56
 
 Modified files:
 	gcc            : ChangeLog 
 	gcc/testsuite  : ChangeLog 
 	gcc/config/i386: i386.md 
 Added files:
 	gcc/testsuite/gcc.c-torture/execute: 20021024-1.c 
 
 Log message:
 	* config/i386/i386.md (subdi3_1): Add call to ix86_binary_operator_ok.
 	PR target/6981
 	* config/i386/i386.md (adddi3_1): Add call to ix86_binary_operator_ok.
 	* gcc.c-torture/execute/20021024-1.c: New test.
 
 Patches:
 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/egcs/gcc/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-3_2-branch&r1=1.13152.2.657.2.104&r2=1.13152.2.657.2.105
 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/egcs/gcc/testsuite/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-3_2-branch&r1=1.1672.2.166.2.38&r2=1.1672.2.166.2.39
 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/egcs/gcc/config/i386/i386.md.diff?cvsroot=gcc&only_with_tag=gcc-3_2-branch&r1=1.339.2.13.2.1&r2=1.339.2.13.2.2
 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/egcs/gcc/testsuite/gcc.c-torture/execute/20021024-1.c.diff?cvsroot=gcc&only_with_tag=gcc-3_2-branch&r1=NONE&r2=1.1.2.1