Bug 2903 - [arm] Optimization bug with long long arithmetic
Summary: [arm] Optimization bug with long long arithmetic
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: rtl-optimization (show other bugs)
Version: 3.1
: P3 normal
Target Milestone: ---
Assignee: Richard Earnshaw
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2001-05-22 11:56 UTC by sean
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
bad_result.c (230 bytes, application/octet-stream)
2003-05-21 15:17 UTC, sean
Details
bic.patch (510 bytes, application/octet-stream)
2003-05-21 15:17 UTC, sean
Details

Note You need to log in before you can comment on or make changes to this bug.
Description sean 2001-05-22 11:56:01 UTC
The attached code produces incorrect results when compiled at -O2 yet is correct without the -On option.

Release:
3.1 20010522 (experimental)

Environment:
Linux 2.4.3 host cross compile to arm-wrs-vxworks

How-To-Repeat:
compiled with

arm-wrs-vxworks-gcc -c -O2 bad_result.c
Comment 1 Richard Earnshaw 2001-07-11 10:53:40 UTC
Responsible-Changed-From-To: unassigned->rearnsha
Responsible-Changed-Why: Mine
Comment 2 Richard Earnshaw 2001-07-11 10:53:40 UTC
State-Changed-From-To: open->feedback
State-Changed-Why: Please try the attached patch
Comment 3 Richard Earnshaw 2001-07-16 10:29:00 UTC
From: Richard Earnshaw <rearnsha@arm.com>
To: Sean McNeil <sean@mcneil.com>
Cc: rearnsha@gcc.gnu.org, gcc-bugs@gcc.gnu.org, gcc-gnats@gcc.gnu.org,
        nobody@gcc.gnu.org
Subject: Re: optimization/2903: Optimization bug with long long arithmetic 
Date: Mon, 16 Jul 2001 10:29:00 +0100

 > The tail end portion of the patch causes a build error.  I am building
 > the compiler now without it and will let you know if it works.
 > 
 > ***************
 > *** 9236,9243 ****
 >   
 >   ;; V5E instructions.
 >   
 > ! (define_insn "prefetch"
 > !   [(unspec_volatile
 >       [(match_operand:SI 0 "offsettable_memory_operand" "o")]
 > VUNSPEC_PREFETCH)]    "TARGET_ARM && arm_arch5e"
 >     "pld\\t%0")
 > --- 9236,9242 ----
 >   
 >   ;; V5E instructions.
 >   
 > ! (define_insn "ppec_volatile
 >       [(match_operand:SI 0 "offsettable_memory_operand" "o")]
 > VUNSPEC_PREFETCH)]    "TARGET_ARM && arm_arch5e"
 >     "pld\\t%0")
 > 
 
 I've no idea where that came from.  It certainly isn't a change I remember 
 making, and it is definitely wrong anyway.
 
 Thanks for pointing out the problem.
 
 R
 

Comment 4 Craig Rodrigues 2002-01-27 19:14:37 UTC
From: Craig Rodrigues <rodrigc@mediaone.net>
To: gcc-gnats@gcc.gnu.org, gcc-prs@gcc.gnu.org, sean@mcneil.com,
   gcc-bugs@gcc.gnu.org, rearnsha@gcc.gnu.org
Cc:  
Subject: Re: optimization/2903: Optimization bug with long long arithmetic
Date: Sun, 27 Jan 2002 19:14:37 -0500

 --------------680271DC94FCE5BC1DC3A36F
 Content-Type: text/plain; charset=us-ascii
 Content-Transfer-Encoding: 7bit
 
 Was the patch submitted in this PR applied to gcc or not?
 Can we close this PR?
 
 http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=2903
 
 --
 Craig Rodrigues
 http://www.gis.net/~craigr
 rodrigc@mediaone.net
 
 
 
 --------------680271DC94FCE5BC1DC3A36F
 Content-Type: text/html; charset=us-ascii
 Content-Transfer-Encoding: 7bit
 
 <!doctype html public "-//w3c//dtd html 4.0 transitional//en">
 <html>
 Was the patch submitted in this PR applied to gcc or not?
 <br>Can we close this PR?
 <p><A HREF="http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&amp;amp;pr=2903">http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&amp;database=gcc&amp;amp;pr=2903</A>
 <pre>--&nbsp;
 Craig Rodrigues&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
 <A HREF="http://www.gis.net/~craigr">http://www.gis.net/~craigr</A>&nbsp;&nbsp;&nbsp;&nbsp;
 rodrigc@mediaone.net</pre>
 &nbsp;</html>
 
 --------------680271DC94FCE5BC1DC3A36F--
 
Comment 5 Wolfgang Bangerth 2002-11-20 18:43:29 UTC
State-Changed-From-To: feedback->closed
State-Changed-Why: No feedback in a long time. Some kind of patch has been
    made to the pattern in question.
Comment 6 Richard Earnshaw 2002-11-21 02:03:25 UTC
State-Changed-From-To: closed->open
State-Changed-Why: Hmm, this seems to have fallen through a crack (the patch wasn't applied for some reason) -- I'll investigate further.
Comment 7 Richard Earnshaw 2002-11-21 07:05:16 UTC
State-Changed-From-To: open->closed
State-Changed-Why: patch now applied
Comment 8 Richard Earnshaw 2002-11-21 14:51:27 UTC
From: rearnsha@gcc.gnu.org
To: gcc-gnats@gcc.gnu.org
Cc:  
Subject: optimization/2903
Date: 21 Nov 2002 14:51:27 -0000

 CVSROOT:	/cvs/gcc
 Module name:	gcc
 Changes by:	rearnsha@gcc.gnu.org	2002-11-21 06:51:27
 
 Modified files:
 	gcc            : ChangeLog 
 	gcc/config/arm : arm.md 
 
 Log message:
 	PR optimization/2903
 	* arm.md (anddi_notzesidi_di): Operand 2 is inverted not operand 1.
 	(anddi_notsesidi_di): Likewise.
 
 Patches:
 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ChangeLog.diff?cvsroot=gcc&r1=1.15964&r2=1.15965
 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/config/arm/arm.md.diff?cvsroot=gcc&r1=1.112&r2=1.113