Bug 7248 - [m68k] broken "inclusive or" code
Summary: [m68k] broken "inclusive or" code
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: target (show other bugs)
Version: 2.95.3
: P3 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords: wrong-code
Depends on:
Blocks:
 
Reported: 2002-07-09 12:36 UTC by martin
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

Note You need to log in before you can comment on or make changes to this bug.
Description martin 2002-07-09 12:36:00 UTC
The following test example outputs 0000000a:00000000 instead
of 0000000a:ffffffff as one would expect.

#include <stdio.h>

typedef unsigned long long Fixed64;

void
test( int a )
{
  Fixed64 f = ( (Fixed64) a << 32) | 0xffffffffULL;

  printf( "%08x:%08x\n", (long) (f >> 32), (long) (f & 0xffffffffULL) );
}

int
main( void )
{
  test( 10 );
}

Release:
gcc version 2.95.3 20010315 (release)

Environment:
AmigaOS or Linux cross compiler.
Comment 1 martin 2002-07-09 12:36:00 UTC
Fix:
--- config/m68k/m68k.md.orig    Tue Jul  9 21:03:52 2002                            +++ config/m68k/m68k.md Tue Jul  9 21:03:55 2002
@@ -3813,23 +3813,23 @@
       if (GET_CODE (operands[0]) == REG)
        operands[0] = gen_rtx_REG (SImode, REGNO (operands[0]) + 1);
       else
        operands[0] = adj_offsettable_operand (operands[0], 4);
       switch (INTVAL (lo))
        {
          case 0 :
            break;                                                                            case -1 :                                                                             /* FIXME : a scratch register would be welcome here if operand[0]                      is not a register */
-           output_asm_insn (\"move%.l %#-1,%R0\", operands);
+           output_asm_insn (\"move%.l %#-1,%0\", operands);
            break;                                                                            default :
            {                                                                                   rtx xoperands[3];
 
            xoperands[0] = operands[0];
            xoperands[2] = lo;
            output_asm_insn (output_iorsi3 (xoperands), xoperands);                
            }
        }
       return \"\";
Comment 2 Wolfgang Bangerth 2003-01-14 13:38:55 UTC
State-Changed-From-To: open->feedback
State-Changed-Why: Your fix has been applied already sometime back in 1997. Do
    you have the chance to test the problem with some newer
    version of gcc? gcc2.95.x is no longer maintained.
    
    Thanks
      Wolfgang
Comment 3 Andreas Schwab 2003-03-14 17:22:49 UTC
From: Andreas Schwab <schwab@suse.de>
To: martin@blom.org, gcc-gnats@gcc.gnu.org, gcc-bugs@gcc.gnu.org,
	bangerth@gcc.gnu.org, gcc-prs@gcc.gnu.org
Cc:  
Subject: Re: target/7248: [m68k] broken "inclusive or" code
Date: Fri, 14 Mar 2003 17:22:49 +0100

 I can still reproduce the bug with gcc 3.4 as of today.  The included
 patch is still needed.  There are no changes around this place since the
 file was imported into CVS.
 
 Andreas.
 
 -- 
 Andreas Schwab, SuSE Labs, schwab@suse.de
 SuSE Linux AG, Deutschherrnstr. 15-19, D-90429 Nürnberg
 Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
 "And now for something completely different."

Comment 4 Andreas Schwab 2003-03-17 10:22:03 UTC
From: schwab@gcc.gnu.org
To: gcc-gnats@gcc.gnu.org
Cc:  
Subject: target/7248
Date: 17 Mar 2003 10:22:03 -0000

 CVSROOT:	/cvs/gcc
 Module name:	gcc
 Branch: 	gcc-3_2-branch
 Changes by:	schwab@gcc.gnu.org	2003-03-17 10:22:03
 
 Modified files:
 	gcc            : ChangeLog 
 	gcc/config/m68k: m68k.md 
 
 Log message:
 	PR target/7248
 	* config/m68k/m68k.md (iordi3): Fix setting low half to -1.  From
 	martin@blom.org.
 
 Patches:
 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-3_2-branch&r1=1.13152.2.657.2.263&r2=1.13152.2.657.2.264
 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/config/m68k/m68k.md.diff?cvsroot=gcc&only_with_tag=gcc-3_2-branch&r1=1.48.8.1.4.2&r2=1.48.8.1.4.3
 

Comment 5 martin 2003-03-18 11:50:13 UTC
From: Martin Blom <martin@blom.org>
To: Andreas Schwab <schwab@suse.de>
Cc: gcc-gnats@gcc.gnu.org, <gcc-bugs@gcc.gnu.org>, <bangerth@gcc.gnu.org>,
   <gcc-prs@gcc.gnu.org>
Subject: Re: target/7248: [m68k] broken "inclusive or" code
Date: Tue, 18 Mar 2003 11:50:13 +0100 (CET)

 | On 14 Jan 2003 bangerth@dealii.org wrote:
 |
 | Old Synopsis: gcc 2.95.3 for m68k generates broken "inclusive or" code
 | New Synopsis: [m68k] broken "inclusive or" code
 |
 | State-Changed-From-To: open->feedback
 | State-Changed-By: bangerth
 | State-Changed-When: Tue Jan 14 13:38:55 2003
 | State-Changed-Why:
 |    Your fix has been applied already sometime back in 1997. Do
 |    you have the chance to test the problem with some newer
 |    version of gcc? gcc2.95.x is no longer maintained.
 
 On Fri, 14 Mar 2003, Andreas Schwab wrote:
 
 > I can still reproduce the bug with gcc 3.4 as of today.  The included
 > patch is still needed.  There are no changes around this place since the
 > file was imported into CVS.
 
 Hi Andreas and the rest ...
 
 That's what I thought when I looked in the CVS before reporting the
 bug. Unfortunately, I've not yet been able to verify it myself by
 actually running a test program built with gcc 3.x for m68k (because
 of, well, "lack of time" and lack of a system able to run gcc
 3.x for m68k). Sorry about that.
 
 -- 
 ---- Martin Blom --------------------------- martin@blom.org ----
 Eccl 1:18                                 http://martin.blom.org/
 
 
 

Comment 6 Andreas Schwab 2003-03-18 19:45:15 UTC
From: schwab@gcc.gnu.org
To: gcc-gnats@gcc.gnu.org
Cc:  
Subject: target/7248
Date: 18 Mar 2003 19:45:15 -0000

 CVSROOT:	/cvs/gcc
 Module name:	gcc
 Branch: 	gcc-3_3-branch
 Changes by:	schwab@gcc.gnu.org	2003-03-18 19:45:15
 
 Modified files:
 	gcc            : ChangeLog 
 	gcc/config/m68k: m68k.md 
 
 Log message:
 	PR target/7248
 	* config/m68k/m68k.md (iordi3): Fix setting low half to -1.  From
 	martin@blom.org.
 
 Patches:
 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-3_3-branch&r1=1.16114.2.320&r2=1.16114.2.321
 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/config/m68k/m68k.md.diff?cvsroot=gcc&only_with_tag=gcc-3_3-branch&r1=1.51.14.2&r2=1.51.14.3
 
Comment 7 Andreas Schwab 2003-03-19 10:02:16 UTC
State-Changed-From-To: feedback->closed
State-Changed-Why: Patch applied to 3.2/3.3/3.4.