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.
When I remove the unnecessary constant legitimate check, lm32-elf-gcc
is built OK.
And I made a patch for this. Please review.
---
gcc/config/lm32/lm32.c | 4 ----
1 file changed, 4 deletions(-)
diff --git a/gcc/config/lm32/lm32.c b/gcc/config/lm32/lm32.c
index 376df05..47024ff 100644
--- a/gcc/config/lm32/lm32.c
+++ b/gcc/config/lm32/lm32.c
@@ -1236,9 +1236,5 @@ lm32_move_ok (enum machine_mode mode, rtx operands[2]) {
static bool
lm32_legitimate_constant_p (enum machine_mode mode, rtx x)
{
- /* 32-bit addresses require multiple instructions. */
- if (!flag_pic && reloc_operand (x, mode))
- return false;
-
return true;
}
--
ChangeLog
2012-07-10 Jia Liu <[email protected]>
gcc/
* config/lm32/lm32.c (lm32_legitimate_constant_p): Remove
unnecessary constant legitimate check.
Regards,
Jia
0001-remove-the-unnecessary-constant-check.patch
Description: Binary data
