This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Reload bug
- From: Eric Botcazou <ebotcazou at libertysurf dot fr>
- To: Jan Hubicka <jh at suse dot cz>
- Cc: gcc at gcc dot gnu dot org
- Date: Wed, 9 Apr 2003 10:35:59 +0200
- Subject: Re: Reload bug
- References: <200304081937.16859.ebotcazou@libertysurf.fr>
> Thu Oct 17 17:14:07 CEST 2002 Jan Hubicka <jh at suse dot cz>
>
> PR opt/7630
> * reload.c (reload_inner_reg_of_subreg): New argument output;
> (push_reload): Update call.
This patch is really bogus, at least on the 3.2 branch: sure, GCC doesn't ICE
when compiling pr7630.c any more but now it silently produces wrong code!
What you have done is to teach the reload pass to silently transform any
non-accessible part of a multi-word register into the low part.
Please revert on the 3.2 branch or consider applying the correction I posted
(which of course brings back the ICE for PR opt/7630).
Thanks.
--
Eric Botcazou
/* PR optimization/7630 */
/* Originator: Jeremy Buhler <jbuhler at cs dot wustl dot edu> */
/* { dg-do compile { target i?86-*-* x86_64-*-* } } */
/* { dg-options "-O -fPIC -march=pentium4" } */
typedef union {
double value;
struct {
unsigned int lsw;
unsigned int msw;
} parts;
} js_ieee_double_shape_type;
#define JSDOUBLE_HI32(x) ({js_ieee_double_shape_type sh_u; \
sh_u.value = (x); \
sh_u.parts.msw; })
enum JSOp {JSOP_URSH, JSOP_DIV};
struct JSParseNode {
enum JSOp pn_op;
double dval;
};
int js_FoldConstants(struct JSParseNode *pn)
{
double d;
switch (pn->pn_op) {
case JSOP_URSH:
d = 0;
case JSOP_DIV:
if (JSDOUBLE_HI32(d) ^ JSDOUBLE_HI32(d))
d = 0;
break;
default:;
}
pn->dval = d;
return 0;
}
.file "pr7630.c"
.section .rodata.cst8,"aM",@progbits,8
.align 8
.LC0:
.long 0
.long 0
.text
.globl js_FoldConstants
.type js_FoldConstants,@function
js_FoldConstants:
fldz
pushl %ebp
movl %esp, %ebp
subl $16, %esp
movl %ebx, -4(%ebp)
call .LPR0
addl $_GLOBAL_OFFSET_TABLE_, %ebx
movl 8(%ebp), %edx
movl (%edx), %eax
testl %eax, %eax
je .L3
cmpl $1, %eax
je .L4
jmp .L2
.L3:
fstp %st(0)
fldl dot LC0 at GOTOFF(%ebx)
.L4:
fstl -16(%ebp)
movsd -16(%ebp), %xmm0
movd %xmm0, %eax
cmpl %eax, %eax
fldl dot LC0 at GOTOFF(%ebx)
fcmove %st(1), %st
fstp %st(1)
.L2:
fstpl 4(%edx)
movl $0, %eax
movl -4(%ebp), %ebx
movl %ebp, %esp
popl %ebp
ret
.Lfe1:
.size js_FoldConstants,.Lfe1-js_FoldConstants
.LPR0:
movl (%esp), %ebx
ret
.ident "GCC: (GNU) 3.2.3 20030405 (prerelease)"