This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c/16562] New: [ H8300 Target] Wrong code with -O2, -O3 optimizations


Following test case generates wrong code with optimization option -O2 or O3.
Details are as under.

h8300-elf-gcc -v
----------------
Configured with: /home/kpit/fsfsrc/downloads/gcc-3.5-20040711/configure --
enable-languages=c,c++ --target=h8300-elf --with-newlib --
prefix=/home/nitins2/intmdt_share/gnuh8300_v0403_elf-1
Thread model: single
gcc version 3.5-GNUH8_v0403

----------------------------------------------
Commandline: h8300-elf-gcc test.c -ms -m2600s -S -O2
//test.c
void theLoop( void )
{
unsigned long int cnt;
cnt = 0L;
do
cnt++;
while (cnt < 1000000L);
}
//test.c

//test.s
	.file	"test.c"
	.h8300s
	.section .text
	.align 2
	.align 1
	.global _theLoop
_theLoop:
	mov.l	er6,@-er7
	mov.l	er7,er6
	mov.l	#999999,er2
.L2:
	sub.l	#50,er2 !This should be 1
	mov.l	er2,er2
	bge	.L2
	mov.l	@er7+,er6
	rts
	.size	_theLoop, .-_theLoop
	.end
//test.s

Additional Info: This bug comes with target options -mh,-ms and -ms2600 only.

-- 
           Summary: [ H8300 Target] Wrong code with -O2, -O3 optimizations
           Product: gcc
           Version: 3.5.0
            Status: UNCONFIRMED
          Severity: critical
          Priority: P2
         Component: c
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: asgarij at kpitcummins dot com
                CC: asgarij at kpitcummins dot com,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: h8300-unknown-elf


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]