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