This is the mail archive of the gcc@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]

Re: [H8300] : BCLR Instruction is not being generated for H8 target


Hi Arati,

> The BCLR instruction does not get generated for current CVS head. Following is my test program.
> 
> #if __H8300S__
> #define PBIT   (*(char *)0xFFFFFFA0) /* FLASH Address*/
> #define PINT   (*(int *)0xFFFF80A0) /* FLASH Address*/
> #define PLONG   (*(long int *)0xFFFF80A0) /* FLASH Address*/
> #elif __H8300H__
> #define PBIT   (*(char *)0xFFFFA0) /* FLASH Address*/
> #define PINT   (*(int *)0xFF80A0) /* FLASH Address*/
> #define PLONG   (*(long int *)0xFF80A0) /* FLASH Address*/
> #else
> #define PBIT   (*(char *)0xFFA0) /* FLASH Address*/
> #define PINT   (*(int *)0xFF80) /* FLASH Address*/
> #define PLONG   (*(long int *)0xFF80) /* FLASH Address*/
> #endif
> 
> void foo()
> {
> 	PBIT |= 0x40 ;
> 	PBIT &= 0xFB ;
> }
> 
> h8300-coff-gcc -S -ms h8test.c
> 
> results in following h8test.s
> 
> ;	GCC For the Hitachi H8/300
> ;	By Hitachi America Ltd and Cygnus Support
> 
> 	.h8300s
> 	.file	"h8test.c"
> 	.section .text
> 	.align 1
> 	.global _foo
> _foo:
> 	mov.l	er6,@-er7
> 	mov.l	er7,er6
> 	bset	#6,@-96:8
> 	mov.b	#-5,r2l
> 	mov.b	@-96:8,r3l
> 	and	r3l,r2l
> 	mov.b	r2l,@-96:8
> 	mov.l	@er7+,er6
> 	rts
> 	.end
> 	.ident	"GCC: (GNU) 3.3 20030113 (prerelease)"

If I specify -O2 -fomit-frame-pointer, I get

_foo:
	mov.b	@-96:8,r2l
	or	#64,r2l
	and	#-5,r2l
	mov.b	r2l,@-96:8
	rts

Do you mean that you want to get a little more optimized code under
-O0?

Kazu Hirata


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