-------- Original Message --------
Subject: Re: [PATCH] [LM32] Fix lm32-elf-gcc build error by remove unnecessary constant legitimate check.
Date: Wed, 11 Jul 2012 22:04:11 -0400 (EDT)
From: Hans-Peter Nilsson <h...@bitrange.com>
To: Jia Liu <pro...@gmail.com>
CC: gcc-patc...@gcc.gnu.org, Sébastien Bourdeauducq <sebast...@milkymist.org>

On Tue, 10 Jul 2012, Jia Liu wrote:
Hi all,

When I build lm32-elf-gcc, it failed at libgcc configure due to
lm32-elf-cc1 segment fault when compile conftest.c:

void bar ();
void clean (int *);
void foo ()
{
  int i __attribute__ ((cleanup (clean)));
  bar();
}

Then I find lm32_legitimate_constant_p return false too much times, it
shouldn't like this, I think.

And I find the movsi pattern has handle the pic and reloc_operand, but
lm32_legitimate_constant_p
handle them again, so, I think maybe it is unnecessary.

The movsi pattern really is expected to handle it; the
TARGET_LEGITIMATE_CONSTANT_P (i.e. lm32_legitimate_constant_p)
is for immediate operands to *other* insns.  The movsi pattern
is expected to handle the rest.  The correct solution is
elsewhere.

When I remove the unnecessary constant legitimate check, lm32-elf-gcc
is built OK.

But most likely will fail to generate correct code for some
source codes for which it worked before.

A patch like this needs a full test-suite run anyway.

(Not an approver-review.)

brgds, H-P


_______________________________________________
http://lists.milkymist.org/listinfo.cgi/devel-milkymist.org
IRC: #milkymist@Freenode

Reply via email to