[Bug optimization/11662] [SPARC] -O1: wrong code for expr. with cast to long long and exclusive or

heinrich dot brand at fujitsu-siemens dot com gcc-bugzilla@gcc.gnu.org
Thu Jul 24 16:21:00 GMT 2003


PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.

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



------- Additional Comments From heinrich dot brand at fujitsu-siemens dot com  2003-07-24 16:21 -------
Subject: AW:  [SPARC] -O1: wrong code for expr. wi
	th cast to long long and exclusive or

No it fails with -01 -fno-delayed-branch too.

This is my assembler file for -O1 -S 
(code for the expression (  (( (unsigned long long)a ^ (unsigned long long)b )  & c)  )  is not in function Test. -fno-delayed-branch does not change function Test):

	.file	"x.c"
	.section	".text"
	.align 4
	.global Test
	.type	Test, #function
	.proc	020
Test:
	!#PROLOGUE# 0
	!#PROLOGUE# 1
	mov	0, %o4
	mov	0, %o5
	sethi	%hi(r), %g1
	retl
	std	%o4, [%g1+%lo(r)]
	.size	Test, .-Test
	.section	".rodata"
	.align 8
.LLC1:
	.asciz	"FAILED"
	.align 8
.LLC0:
	.asciz	"PASSED"
	.section	".text"
	.align 4
	.global main
	.type	main, #function
	.proc	04
main:
	!#PROLOGUE# 0
	save	%sp, -112, %sp
	!#PROLOGUE# 1
	mov	1, %o0
	mov	2, %o1
	mov	0, %o2
	call	Test, 0
	mov	3, %o3
	sethi	%hi(r), %g1
	or	%g1, %lo(r), %o5
	ld	[%g1+%lo(r)], %g1
	cmp	%g1, 0
	bne	.LL5
	sethi	%hi(.LLC1), %o0
	ld	[%o5+4], %g1
	cmp	%g1, 3
	bne	.LL5
	nop
	sethi	%hi(.LLC0), %o0
	call	puts, 0
	or	%o0, %lo(.LLC0), %o0
	b	.LL2
	mov	0, %i0
.LL5:
	call	puts, 0
	or	%o0, %lo(.LLC1), %o0
	mov	1, %i0
.LL2:
	nop
	ret
	restore
	.size	main, .-main
	.local	r
	.common	r,8,8
	.ident	"GCC: (GNU) 3.3"

-----Ursprüngliche Nachricht-----
Von: pinskia at physics dot uc dot edu [mailto:gcc-bugzilla@gcc.gnu.org]
Gesendet: Donnerstag, 24. Juli 2003 17:21
An: Brand, Heinrich
Betreff: [Bug optimization/11662] [SPARC] -O1: wrong code for expr. with
cast to long long and exclusive or


PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.

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


pinskia at physics dot uc dot edu changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |WAITING
            Summary|[SPARC] -O1: wrong code for |[SPARC] -O1: wrong code for
                   |expr. with cast to long long|expr. with cast to long long
                   |and exclusive or            |and exclusive or


------- Additional Comments From pinskia at physics dot uc dot edu  2003-07-24 15:20 -------
Does this work with -fno-delayed-branch?
I do not know the rules on sparc for delay slots of branch instructions so if it works with that then 
that is the problem because looking to at the asm looks right except for the store after the return.



------- You are receiving this mail because: -------
You reported the bug, or are watching the reporter.

-----Ursprüngliche Nachricht-----
Von: pinskia at physics dot uc dot edu [mailto:gcc-bugzilla@gcc.gnu.org]
Gesendet: Donnerstag, 24. Juli 2003 17:21
An: Brand, Heinrich
Betreff: [Bug optimization/11662] [SPARC] -O1: wrong code for expr. with
cast to long long and exclusive or


PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.

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


pinskia at physics dot uc dot edu changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |WAITING
            Summary|[SPARC] -O1: wrong code for |[SPARC] -O1: wrong code for
                   |expr. with cast to long long|expr. with cast to long long
                   |and exclusive or            |and exclusive or


------- Additional Comments From pinskia at physics dot uc dot edu  2003-07-24 15:20 -------
Does this work with -fno-delayed-branch?
I do not know the rules on sparc for delay slots of branch instructions so if it works with that then 
that is the problem because looking to at the asm looks right except for the store after the return.



------- You are receiving this mail because: -------
You reported the bug, or are watching the reporter.



More information about the Gcc-bugs mailing list