This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
execute/950503-1.c failing at all optimization levels on x86
- To: gcc-bugs at gcc dot gnu dot org
- Subject: execute/950503-1.c failing at all optimization levels on x86
- From: Zack Weinberg <zack at bitmover dot com>
- Date: Sun, 01 Aug 1999 21:52:30 -0700
execute/950503-1.c is a test for proper handling of compile time
shifts of "long long" quantities. It's failing at all optimization
levels with current CVS. 1.1.2 had no trouble.
The appended assembly dump is cc1 output at -O0 for this test case.
Note the anonymous constants at the top of the file:
.LC0:
.long -1
.long 0
.align 4
.LC1:
.long -1
.long 65535
I believe the first constant should have been assembled as
.LC0:
.long -1
.long -1
1.1.2 emits the constants in-line, so a direct comparison is not
possible. I am guessing that this is a bug in expand_expr or its
subroutines. I can't put my finger on a line of code or a
suspicious-looking change, though.
zw
.file "950503-1.c"
.version "01.01"
gcc2_compiled.:
.section .rodata
.align 4
.LC0:
.long -1
.long 0
.align 4
.LC1:
.long -1
.long 65535
.text
.align 4
.globl main
.type main,@function
main:
pushl %ebp
movl %esp,%ebp
subl $36,%esp
pushl %ebx
movl $16,-4(%ebp)
movl .LC0,%eax
movl .LC0+4,%edx
movb -4(%ebp),%cl
movb %cl,%bl
movb %bl,%cl
shrdl %edx,%eax
shrl %cl,%edx
testb $32,%cl
je .L5
movl %edx,%eax
xorl %edx,%edx
.L5:
movl %eax,-12(%ebp)
movl %edx,-8(%ebp)
movl .LC1,%eax
movl .LC1+4,%edx
movl %eax,-20(%ebp)
movl %edx,-16(%ebp)
movl -12(%ebp),%eax
cmpl -20(%ebp),%eax
jne .L4
movl -8(%ebp),%eax
cmpl -16(%ebp),%eax
jne .L4
jmp .L3
.p2align 4,,7
.L4:
call abort
.p2align 4,,7
.L3:
addl $-12,%esp
pushl $0
call exit
addl $16,%esp
.p2align 4,,7
.L2:
movl -40(%ebp),%ebx
movl %ebp,%esp
popl %ebp
ret
.Lfe1:
.size main,.Lfe1-main
.ident "GCC: (GNU) 2.96 19990801 (experimental)"