public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/15869] New: No NOP after LW (with -mips1 -O0)
@ 2004-06-08  8:10 niva at niisi dot msk dot ru
  2004-06-08 11:47 ` [Bug target/15869] " pinskia at gcc dot gnu dot org
                   ` (11 more replies)
  0 siblings, 12 replies; 13+ messages in thread
From: niva at niisi dot msk dot ru @ 2004-06-08  8:10 UTC (permalink / raw)
  To: gcc-bugs

* the complete command line that triggers the bug;

mips64-none-elf-gcc bar.c -v -O0 -G0 -mips1 -mabi=32 -S -v

     * The resultant code works incorrectly because there is no NOP between
       the following commands:

	lw	$2,%lo(lastc.1)($2)
	xor	$2,$3,$2



     * the  preprocessed  file (*.i*) that triggers the bug, generated by
       adding -save-temps to the complete compilation command, or, in the
       case  of  a  bug  report for the GNAT front end, a complete set of
       source files (see below).

void bar (int n, int c)
{
  static int lastn = -1, lastc = -1;

  if (lastn != n)
    {
      if (lastc != lastn)
	abort ();
      lastc = 0;
      lastn = n;
    }

  if (c != (char) (lastc ^ (n << 3)))
    abort ();
  lastc++;
}

     * The resultant assembler code

	.file	1 "bar.c"
	.section .mdebug.abi32
	.previous
	.data
	.align	2
	.type	lastn.0, @object
	.size	lastn.0, 4
lastn.0:
	.word	-1
	.align	2
	.type	lastc.1, @object
	.size	lastc.1, 4
lastc.1:
	.word	-1
	.text
	.align	2
	.globl	bar
	.ent	bar
bar:
	.frame	$fp,24,$31		# vars= 0, regs= 2/0, args= 16, gp= 0
	.mask	0xc0000000,-4
	.fmask	0x00000000,0
	.set	noreorder
	.set	nomacro
	
	addiu	$sp,$sp,-24
	sw	$31,20($sp)
	sw	$fp,16($sp)
	move	$fp,$sp
	sw	$4,24($fp)
	sw	$5,28($fp)
	lui	$2,%hi(lastn.0)
	lw	$3,%lo(lastn.0)($2)
	lw	$2,24($fp)
	nop
	beq	$3,$2,$L2
	nop

	lui	$2,%hi(lastc.1)
	lui	$3,%hi(lastn.0)
	lw	$4,%lo(lastc.1)($2)
	lw	$2,%lo(lastn.0)($3)
	nop
	beq	$4,$2,$L3
	nop

	jal	abort
	nop

$L3:
	lui	$2,%hi(lastc.1)
	sw	$0,%lo(lastc.1)($2)
	lui	$3,%hi(lastn.0)
	lw	$2,24($fp)
	nop
	sw	$2,%lo(lastn.0)($3)
$L2:
	lw	$2,24($fp)
	nop
	sll	$3,$2,3
	lui	$2,%hi(lastc.1)
	lw	$2,%lo(lastc.1)($2)
	xor	$2,$3,$2
	sll	$3,$2,24
	sra	$3,$3,24
	lw	$2,28($fp)
	nop
	beq	$3,$2,$L4
	nop

	jal	abort
	nop

$L4:
	lui	$3,%hi(lastc.1)
	lui	$2,%hi(lastc.1)
	lw	$2,%lo(lastc.1)($2)
	nop
	addiu	$2,$2,1
	sw	$2,%lo(lastc.1)($3)
	move	$sp,$fp
	lw	$31,20($sp)
	lw	$fp,16($sp)
	addiu	$sp,$sp,24
	j	$31
	nop

	.set	macro
	.set	reorder
	.end	bar

-- 
           Summary: No NOP after LW (with -mips1 -O0)
           Product: gcc
           Version: 3.4.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: c
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: niva at niisi dot msk dot ru
                CC: gcc-bugs at gcc dot gnu dot org
 GCC build triplet: i686-pc-linux-gnu
  GCC host triplet: i686-pc-linux-gnu
GCC target triplet: mips64-none-elf


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=15869


^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2004-07-07  6:33 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-06-08  8:10 [Bug c/15869] New: No NOP after LW (with -mips1 -O0) niva at niisi dot msk dot ru
2004-06-08 11:47 ` [Bug target/15869] " pinskia at gcc dot gnu dot org
2004-06-22  8:18 ` rsandifo at gcc dot gnu dot org
2004-06-22 21:28 ` cvs-commit at gcc dot gnu dot org
2004-06-22 21:32 ` rsandifo at gcc dot gnu dot org
2004-06-22 21:38 ` [Bug target/15869] [3.4 Regression] " pinskia at gcc dot gnu dot org
2004-06-23  6:55 ` rsandifo at gcc dot gnu dot org
2004-06-23  7:05 ` mmitchel at gcc dot gnu dot org
2004-06-23  7:10 ` rsandifo at redhat dot com
2004-06-23 16:04 ` mark at codesourcery dot com
2004-06-23 17:00 ` rsandifo at redhat dot com
2004-07-07  6:28 ` cvs-commit at gcc dot gnu dot org
2004-07-07  6:33 ` rsandifo at gcc dot gnu dot org

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