Bug 2903

Summary: [arm] Optimization bug with long long arithmetic
Product: gcc Reporter: sean
Component: rtl-optimizationAssignee: Richard Earnshaw <rearnsha>
Severity: normal CC: gcc-bugs, rearnsha, rodrigc
Priority: P3    
Version: 3.1   
Target Milestone: ---   
Host: Target:
Build: Known to work:
Known to fail: Last reconfirmed:
Attachments: bad_result.c

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.

3.1 20010522 (experimental)

Linux 2.4.3 host cross compile to arm-wrs-vxworks

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,
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.

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
Subject: Re: optimization/2903: Optimization bug with long long arithmetic
Date: Sun, 27 Jan 2002 19:14:37 -0500

 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?
 Craig Rodrigues
 Content-Type: text/html; charset=us-ascii
 Content-Transfer-Encoding: 7bit
 <!doctype html public "-//w3c//dtd html 4.0 transitional//en">
 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>
 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;
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
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.