This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH, rtl]: Remove invalid assert from caller-save.c
- From: Eric Botcazou <ebotcazou at adacore dot com>
- To: Uros Bizjak <ubizjak at gmail dot com>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Tue, 24 Nov 2009 22:42:27 +0100
- Subject: Re: [PATCH, rtl]: Remove invalid assert from caller-save.c
- References: <4B0C3D42.3030600@gmail.com>
> However, value of 0 is perfectly valid return value for recog_memoized.
> I learned this the hard way, as shown from generated insn-recog.c:
>
> static int
> recog_1 (rtx x0 ATTRIBUTE_UNUSED,
> rtx insn ATTRIBUTE_UNUSED,
> int *pnum_clobbers ATTRIBUTE_UNUSED)
> {
> ...
> {
> return 0; /* *movqi */
> }
> x1 = XEXP (x0, 0);
> goto L237;
> ...
> ret0:
> return -1;
> }
>
> Attached one-liner fixes this oversight.
Well, all the logic would need to be rewritten then:
static int
reg_save_code (int reg, enum machine_mode mode)
{
bool ok;
if (cached_reg_save_code[reg][mode])
return cached_reg_save_code[reg][mode];
static int
reg_restore_code (int reg, enum machine_mode mode)
{
if (cached_reg_restore_code[reg][mode])
return cached_reg_restore_code[reg][mode];
Can't you just avoid having "movqi" associated with 0?
--
Eric Botcazou