[patch, ARM] Fix minipool ICE

Richard Earnshaw rearnsha@arm.com
Sat Mar 5 14:09:00 GMT 2011


On Mon, 2011-02-28 at 23:40 +0800, Chung-Lin Tang wrote:
> On 2011/2/28 11:07 PM, Richard Earnshaw wrote:
> > 
> > On Mon, 2011-02-07 at 14:09 +0800, Chung-Lin Tang wrote:
> >> Hi,
> >> the *arm_zero_extendhisi2[_v6] patterns currently do not have the
> >> constant pool range attributes specified, causing a minipool ICE case.
> >> This patch adds the needed pool_range/neg_pool_range settings.
> >>
> >> Reported originally from https://bugs.launchpad.net/bugs/711819 , also
> >> happens to occur when building ffmpeg svn trunk.
> >>
> >> Ok for trunk?
> >>
> >> Thanks,
> >> Chung-Lin
> >>
> >> 2011-02-07  Chung-Lin Tang  <cltang@codesourcery.com>
> >>
> >>         * config/arm/arm.md (*arm_zero_extendhisi2): Set pool_range,
> >>         neg_pool_range attributes for ldrh alternative.
> >>         (*arm_zero_extendhisi2_v6): Same.
> > 
> > This is wrong.  Neither the predicate nor the constraint accept an
> > immediate, so these should never need to generate mini-pool entries.  If
> > reload is letting these through, then that's a bug in reload IMO.  If
> > it's not reload, then that needs investigating further too.
> 
> Hi Richard,
> 
> To re-cap some of the discussion Bernd, Ramana, and I had off-list: we
> are seeing in some cases, IRA/reload ending up with insns with constant
> pool references (not generated from ARM reorg):
> (insn 262 92 94 3 (set (reg:HI 4 r4 [orig:328 iftmp.6 ] [328])
>         (mem/u/c/i:HI (symbol_ref/u:SI ("*.LC0") [flags 0x2]) [2 S2
> A16])) k.c:11 177 {*movhi_insn_arch4}
>      (expr_list:REG_EQUAL (const_int 2047 [0x7ff])
>         (nil)))
> 

Thanks for the testcase.  It looks like the problems all started when
the insn above was created.  Reload shouldn't have done that, but was
forced to because the constant being spilt wasn't valid in the
arm_movhi_arch4 pattern.  Once that is done we start down the slippery
slope that leads to the ICE.

It's easily fixed by making that pattern accept any constant and then
processing that directly into the minipools rather than letting reload
push it in to the per-function constant pool and then trying to
eliminate that.

We should do more to optimize handling of constants in HImode,
particularly when we have MOVW available.  But for now this patch will
solve the ICE.

2011-03-05  Richard Earnshaw  <rearnsha@arm.com>

	PR target/47719
	* arm.md (movhi_insn_arch4):  Accept any immediate constant.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: himode.patch
Type: text/x-patch
Size: 1057 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20110305/93bbdf4e/attachment.bin>


More information about the Gcc-patches mailing list