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]

GCC 2.97 for Hitachi SH4 bug


Good day!

We have used GCC 2.97 for SH4 (but I'm affraid that is true for other
platforms)
and found next problem :

/* ============ test.cpp ============ */
class A
{
static volatile long * const t = ( volatile long * )0xff800000;
public:

static void Store( long d ) { *t = d; };
};

void test()
{
  A::Store( 10);
}
/* ============ end test.cpp ============ */

After compilation we have:

! ============ test.s ============ 
	.file	"test.cpp"
	.little
gcc2_compiled.:
	.section	.debug_abbrev
.Ldebug_abbrev0:
	.section	.text
.Ltext0:
	.section	.debug_info
.Ldebug_info0:
	.section	.debug_line
.Ldebug_line0:
	.text
	.align 5
	.global	_test__Fv
	.type	_test__Fv,@function
_test__Fv:
.LFB1:
	.file 0 "test.cpp"
	.loc 0 10 0
.LBB2:
	.loc 0 6 0
	mov.l	.L5,r1
	mov	#10,r2
	.loc 0 10 0
	mov.l	r14,@-r15
	mov	r15,r14
	.loc 0 6 0
	mov.l	r2,@r1
	mov.l	@r1,r1   !!!!!????? - this's STRANGE operation :(
	.loc 0 12 0
	mov	r14,r15
	rts	
	mov.l	@r15+,r14
.L6:
	.align 2
.L5:
	.long	-8388608
.LBE2:
.LFE1:
.Lfe1:
	.size	_test__Fv,.Lfe1-_test__Fv
...
! ============ test.s ============ 

This ploblem is very actual for programming peripheral devices with his
own
clock synchronization, then we must make delay between two consistent
accesses.

We haven't this problem with 2.95.2 but it have a lot of his own bugs
...
We shall try to make fix for this problem and put to you result.
We would appreciate for some comment and prompting from you :)

Compilation string:
gcc -b sh -m4 -ml -O2 -S test.cpp

I've attached test.cpp and test.s to this message.

BR,
Serguei
Ashtech Inc.

test.cpp

	.file	"test.cpp"
	.little
gcc2_compiled.:
	.section	.debug_abbrev
.Ldebug_abbrev0:
	.section	.text
.Ltext0:
	.section	.debug_info
.Ldebug_info0:
	.section	.debug_line
.Ldebug_line0:
	.text
	.align 5
	.global	_test__Fv
	.type	_test__Fv,@function
_test__Fv:
.LFB1:
	.file 0 "test.cpp"
	.loc 0 10 0
.LBB2:
	.loc 0 6 0
	mov.l	.L5,r1
	mov	#10,r2
	.loc 0 10 0
	mov.l	r14,@-r15
	mov	r15,r14
	.loc 0 6 0
	mov.l	r2,@r1
	mov.l	@r1,r1
	.loc 0 12 0
	mov	r14,r15
	rts	
	mov.l	@r15+,r14
.L6:
	.align 2
.L5:
	.long	-8388608
.LBE2:
.LFE1:
.Lfe1:
	.size	_test__Fv,.Lfe1-_test__Fv

	.section	.text
.Letext0:

	.section	.debug_info
	.ualong	0x1ea
	.uaword	0x2
	.ualong	.Ldebug_abbrev0
	.byte	0x4
	.byte	0x1
	.ualong	.Ldebug_line0
	.ualong	.Letext0
	.ualong	.Ltext0
	.string	"test.cpp"

	.string	"/home/bul/cheetah/nmea"

	.string	"GNU C++ 2.97 20001120 (experimental)"

	.byte	0x4
	.byte	0x2
	.ualong	0x107
	.string	"A"

	.byte	0x1
	.byte	0x1
	.byte	0x2
	.byte	0x3
	.string	"t"

	.byte	0x1
	.byte	0x3
	.string	"_1A.t"

	.ualong	0x107
	.byte	0x1
	.byte	0x3
	.byte	0x1
	.byte	0x4
	.ualong	0xa9
	.byte	0x1
	.string	"operator="

	.string	"__as__1ARC1A"

	.ualong	0x123
	.byte	0x1
	.byte	0x1
	.byte	0x5
	.ualong	0x129
	.byte	0x1
	.byte	0x6
	.ualong	0x12f
	.byte	0x0
	.byte	0x4
	.ualong	0xcc
	.byte	0x1
	.string	"A"

	.string	"__1ARC1A"

	.ualong	0x129
	.byte	0x1
	.byte	0x1
	.byte	0x5
	.ualong	0x129
	.byte	0x1
	.byte	0x6
	.ualong	0x12f
	.byte	0x0
	.byte	0x4
	.ualong	0xe6
	.byte	0x1
	.string	"A"

	.string	"__1A"

	.ualong	0x129
	.byte	0x1
	.byte	0x1
	.byte	0x5
	.ualong	0x129
	.byte	0x1
	.byte	0x0
	.byte	0x7
	.byte	0x1
	.string	"Store"

	.byte	0x1
	.byte	0x6
	.string	"Store__1Al"

	.byte	0x3
	.byte	0x8
	.string	"d"

	.byte	0x1
	.byte	0x6
	.ualong	0x117
	.byte	0x0
	.byte	0x0
	.byte	0x9
	.ualong	0x10c
	.byte	0xa
	.byte	0x4
	.ualong	0x112
	.byte	0xb
	.ualong	0x117
	.byte	0xc
	.string	"long int"

	.byte	0x4
	.byte	0x5
	.byte	0xd
	.byte	0x4
	.ualong	0x5e
	.byte	0xa
	.byte	0x4
	.ualong	0x5e
	.byte	0xd
	.byte	0x4
	.ualong	0x135
	.byte	0x9
	.ualong	0x5e
	.byte	0xe
	.ualong	0x170
	.byte	0x1
	.string	"test"

	.byte	0x1
	.byte	0xa
	.string	"test__Fv"

	.ualong	.LFB1
	.ualong	.LFE1
	.byte	0x1
	.byte	0x5e
	.byte	0xf
	.ualong	0xe6
	.ualong	.LBB2
	.ualong	.LBE2
	.byte	0x10
	.ualong	0xfc
	.byte	0x1
	.byte	0x52
	.byte	0x0
	.byte	0x0
	.byte	0x11
	.ualong	0x68
	.byte	0x1
	.byte	0xc
	.string	"bool"

	.byte	0x1
	.byte	0x2
	.byte	0x12
	.ualong	0x18e
	.ualong	0x19e
	.byte	0x13
	.ualong	0x18e
	.byte	0x0
	.byte	0x0
	.byte	0xc
	.string	"unsigned int"

	.byte	0x4
	.byte	0x7
	.byte	0xc
	.string	"char"

	.byte	0x1
	.byte	0x6
	.byte	0x14
	.string	"__FUNCTION__"

	.ualong	0x1b9
	.byte	0x1
	.byte	0x9
	.ualong	0x17e
	.byte	0x12
	.ualong	0x1ce
	.ualong	0x19e
	.byte	0x13
	.ualong	0x18e
	.byte	0x9
	.byte	0x0
	.byte	0x14
	.string	"__PRETTY_FUNCTION__"

	.ualong	0x1e8
	.byte	0x1
	.byte	0x9
	.ualong	0x1be
	.byte	0x0

	.section	.debug_abbrev
	.byte	0x1
	.byte	0x11
	.byte	0x1
	.byte	0x10
	.byte	0x6
	.byte	0x12
	.byte	0x1
	.byte	0x11
	.byte	0x1
	.byte	0x3
	.byte	0x8
	.byte	0x1b
	.byte	0x8
	.byte	0x25
	.byte	0x8
	.byte	0x13
	.byte	0xb
	.byte	0,0
	.byte	0x2
	.byte	0x13
	.byte	0x1
	.byte	0x1
	.byte	0x13
	.byte	0x3
	.byte	0x8
	.byte	0xb
	.byte	0xb
	.byte	0x3a
	.byte	0xb
	.byte	0x3b
	.byte	0xb
	.byte	0,0
	.byte	0x3
	.byte	0x34
	.byte	0x0
	.byte	0x3
	.byte	0x8
	.byte	0x3a
	.byte	0xb
	.byte	0x3b
	.byte	0xb
	.byte	0x87,0x40
	.byte	0x8
	.byte	0x49
	.byte	0x13
	.byte	0x3f
	.byte	0xc
	.byte	0x32
	.byte	0xb
	.byte	0x3c
	.byte	0xc
	.byte	0,0
	.byte	0x4
	.byte	0x2e
	.byte	0x1
	.byte	0x1
	.byte	0x13
	.byte	0x3f
	.byte	0xc
	.byte	0x3
	.byte	0x8
	.byte	0x87,0x40
	.byte	0x8
	.byte	0x49
	.byte	0x13
	.byte	0x34
	.byte	0xc
	.byte	0x3c
	.byte	0xc
	.byte	0,0
	.byte	0x5
	.byte	0x5
	.byte	0x0
	.byte	0x49
	.byte	0x13
	.byte	0x34
	.byte	0xc
	.byte	0,0
	.byte	0x6
	.byte	0x5
	.byte	0x0
	.byte	0x49
	.byte	0x13
	.byte	0,0
	.byte	0x7
	.byte	0x2e
	.byte	0x1
	.byte	0x3f
	.byte	0xc
	.byte	0x3
	.byte	0x8
	.byte	0x3a
	.byte	0xb
	.byte	0x3b
	.byte	0xb
	.byte	0x87,0x40
	.byte	0x8
	.byte	0x20
	.byte	0xb
	.byte	0,0
	.byte	0x8
	.byte	0x5
	.byte	0x0
	.byte	0x3
	.byte	0x8
	.byte	0x3a
	.byte	0xb
	.byte	0x3b
	.byte	0xb
	.byte	0x49
	.byte	0x13
	.byte	0,0
	.byte	0x9
	.byte	0x26
	.byte	0x0
	.byte	0x49
	.byte	0x13
	.byte	0,0
	.byte	0xa
	.byte	0xf
	.byte	0x0
	.byte	0xb
	.byte	0xb
	.byte	0x49
	.byte	0x13
	.byte	0,0
	.byte	0xb
	.byte	0x35
	.byte	0x0
	.byte	0x49
	.byte	0x13
	.byte	0,0
	.byte	0xc
	.byte	0x24
	.byte	0x0
	.byte	0x3
	.byte	0x8
	.byte	0xb
	.byte	0xb
	.byte	0x3e
	.byte	0xb
	.byte	0,0
	.byte	0xd
	.byte	0x10
	.byte	0x0
	.byte	0xb
	.byte	0xb
	.byte	0x49
	.byte	0x13
	.byte	0,0
	.byte	0xe
	.byte	0x2e
	.byte	0x1
	.byte	0x1
	.byte	0x13
	.byte	0x3f
	.byte	0xc
	.byte	0x3
	.byte	0x8
	.byte	0x3a
	.byte	0xb
	.byte	0x3b
	.byte	0xb
	.byte	0x87,0x40
	.byte	0x8
	.byte	0x11
	.byte	0x1
	.byte	0x12
	.byte	0x1
	.byte	0x40
	.byte	0xa
	.byte	0,0
	.byte	0xf
	.byte	0x1d
	.byte	0x1
	.byte	0x31
	.byte	0x13
	.byte	0x11
	.byte	0x1
	.byte	0x12
	.byte	0x1
	.byte	0,0
	.byte	0x10
	.byte	0x5
	.byte	0x0
	.byte	0x31
	.byte	0x13
	.byte	0x2
	.byte	0xa
	.byte	0,0
	.byte	0x11
	.byte	0x34
	.byte	0x0
	.byte	0x47
	.byte	0x13
	.byte	0x3c
	.byte	0xc
	.byte	0,0
	.byte	0x12
	.byte	0x1
	.byte	0x1
	.byte	0x1
	.byte	0x13
	.byte	0x49
	.byte	0x13
	.byte	0,0
	.byte	0x13
	.byte	0x21
	.byte	0x0
	.byte	0x49
	.byte	0x13
	.byte	0x2f
	.byte	0xb
	.byte	0,0
	.byte	0x14
	.byte	0x34
	.byte	0x0
	.byte	0x3
	.byte	0x8
	.byte	0x49
	.byte	0x13
	.byte	0x34
	.byte	0xc
	.byte	0,0
	.byte	0

	.section	.debug_pubnames
	.ualong	0x17
	.uaword	0x2
	.ualong	.Ldebug_info0
	.ualong	0x1ee
	.ualong	0x13a
	.string	"test"

	.ualong	0x0

	.section	.debug_aranges
	.ualong	0x1c
	.uaword	0x2
	.ualong	.Ldebug_info0
	.byte	0x4
	.byte	0x0
	.uaword	0x0,0
	.ualong	.Ltext0
	.ualong	.Letext0-.Ltext0
	.ualong	0x0
	.ualong	0x0
	.ident	"GCC: (GNU) 2.97 20001120 (experimental)"

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