public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
* target/7248: gcc 2.95.3 for m68k generates broken "inclusive or" code
@ 2002-07-09 12:36 martin
  0 siblings, 0 replies; only message in thread
From: martin @ 2002-07-09 12:36 UTC (permalink / raw)
  To: gcc-gnats


>Number:         7248
>Category:       target
>Synopsis:       gcc 2.95.3 for m68k generates broken "inclusive or" code
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          wrong-code
>Submitter-Id:   net
>Arrival-Date:   Tue Jul 09 12:36:00 PDT 2002
>Closed-Date:
>Last-Modified:
>Originator:     martin@blom.org
>Release:        gcc version 2.95.3 20010315 (release)
>Organization:
>Environment:
AmigaOS or Linux cross compiler.
>Description:
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 );
}
>How-To-Repeat:

>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 \"\";
>Release-Note:
>Audit-Trail:
>Unformatted:


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2002-07-09 19:36 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-07-09 12:36 target/7248: gcc 2.95.3 for m68k generates broken "inclusive or" code martin

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