This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug optimization/10392] [3.3/3.4 regression] [SH] optimizer generates faulty array indexing
- From: "joern dot rennecke at superh dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 14 Jan 2004 19:03:46 -0000
- Subject: [Bug optimization/10392] [3.3/3.4 regression] [SH] optimizer generates faulty array indexing
- References: <20030413145600.10392.marcus@mc.pp.se>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Additional Comments From joern dot rennecke at superh dot com 2004-01-14 19:03 -------
Subject: Re: [3.3/3.4 regression] [SH] optimizer generates faulty array indexing
> ------- Additional Comments From gdr at gcc dot gnu dot org 2003-12-21 18:45 -------
> Joern --
>
> This bug is present on both 3.3.x branch and mainline.
> It has "Severity:" set to critical. Do you think we should
> keep it open for 3.3.3? (There is virtually no chance I fix
> this myself as I don't speak SH).
AFAICS the problem is no longer present in mainline; I've attached the output
I get with yesterday's compiler. When did you last reconfirm the bug?
The incorrect use of reload registers observed is consistent with
a problem in reg_overlap_mentioned_for_reload_p that I've fixed with
this patch:
2003-12-15 J"orn Rennecke <joern.rennecke@superh.com>
* reload.c (reg_overlap_mentioned_for_reload_p):
When looking at a PLUS in X, avoid spuriously returning nonzero
when IN is a REG or another simple PLUS, or a MEM containing one.
http://gcc.gnu.org/ml/gcc-patches/2003-09/msg01299.html
.file "10392.c"
.text
.section .rodata.str1.4,"aMS",@progbits,1
.align 2
.LC0:
.string "one"
.align 2
.LC1:
.string "two"
.text
.align 1
.align 5
.global _func
.type _func, @function
_func:
mov.l r8,@-r15
mov.l r9,@-r15
mov.l r10,@-r15
mov #0,r10
mov.l r11,@-r15
mov r5,r11
mov.l r12,@-r15
mov r4,r12
mov.l r13,@-r15
mov #1,r13
mov.l r14,@-r15
sts.l pr,@-r15
mov.w .L13,r0
add #-68,r15
mov.l .L10,r1
add #-68,r15
mov r15,r14
add r14,r0
mov.l r1,@r0
mov.l .L11,r9
mov.l .L12,r1
mov.l r1,@(4,r0)
.L5:
mov.w .L13,r1
mov r10,r2
shll2 r2
mov r14,r0
add r2,r1
jsr @r9
mov.l @(r0,r1),r4
jsr @r9
mov r14,r4
mov r12,r4
jsr @r9
mov r0,r8
jsr @r9
mov r11,r4
jsr @r9
mov r8,r4
mov r10,r1
add #1,r1
extu.b r1,r10
cmp/hi r13,r10
bf .L5
add #68,r14
add #68,r14
mov r14,r15
lds.l @r15+,pr
mov.l @r15+,r14
mov.l @r15+,r13
mov.l @r15+,r12
mov.l @r15+,r11
mov.l @r15+,r10
mov.l @r15+,r9
rts
mov.l @r15+,r8
.align 1
.L13:
.short 128
.L14:
.align 2
.L10:
.long .LC0
.L11:
.long _use
.L12:
.long .LC1
.size _func, .-_func
.ident "GCC: (GNU) 3.4.0 20040113 (experimental)"
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=10392