Postscript: Output with patch is exactly what you'd expect:<div><br></div><div><div><font class="Apple-style-span" face="'courier new', monospace">_foo:                                   @ @foo</font></div><div>
<font class="Apple-style-span" face="'courier new', monospace">@ BB#0:                                 @ %entry</font></div><div><font class="Apple-style-span" face="'courier new', monospace">        mvn     r1, #0</font></div>
<div><font class="Apple-style-span" face="'courier new', monospace">        strb    r1, [r0, #3]</font></div><div><font class="Apple-style-span" face="'courier new', monospace">        strb    r1, [r0, #2]</font></div>
<div><font class="Apple-style-span" face="'courier new', monospace">        strb    r1, [r0, #1]</font></div><div><font class="Apple-style-span" face="'courier new', monospace">        strb    r1, [r0]</font></div>
<div><font class="Apple-style-span" face="'courier new', monospace">        mov     pc, lr</font></div><div><br></div><div>Cheers,</div><div>Lang.</div><div><br><div class="gmail_quote">On Fri, Nov 4, 2011 at 4:30 PM, Lang Hames <span dir="ltr"><<a href="mailto:lhames@gmail.com">lhames@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">Encountered the following when I tried outputting an unaligned store of -1 on ARM:<div><br></div><div><div><font face="'courier new', monospace">_foo:                                   @ @foo</font></div>

<div><font face="'courier new', monospace">@ BB#0:                                 @ %entry</font></div><div><font face="'courier new', monospace">        mov     r1, #255</font></div>
<div><font face="'courier new', monospace">        mov     r2, #255</font></div><div><font face="'courier new', monospace">        strb    r1, [r0, #3]</font></div>
<div><font face="'courier new', monospace">        orr     r1, r2, #65280</font></div><div><font face="'courier new', monospace">        strb    r1, [r0, #2]</font></div>
<div><font face="'courier new', monospace">        mvn     r1, #-16777216</font></div><div><font face="'courier new', monospace">        strb    r1, [r0, #1]</font></div>
<div><font face="'courier new', monospace">        mvn     r1, #0</font></div><div><font face="'courier new', monospace">        strb    r1, [r0]</font></div>
<div><font face="'courier new', monospace">        mov     pc, lr</font></div></div><div><br></div><div>The strange constants are coming out of the legalizer, which tries to legalize the unaligned store by repeatedly splitting it into two half-sized stores, and shifting the constant around. This results in several new and confusing constants being introduced.</div>

<div><br></div><div>This patch checks for constant value stores, and if the two halves of the constant have the same bit-pattern it avoids creating new constants.</div><div><br></div><div>Could someone who's more familiar with the legalizer take a look and let me know if this is Ok to commit?  (I'm also planning to enable unaligned stores on supported subtargets, but that's a different issue)</div>

<div><br></div><div>Cheers,</div><span class="HOEnZb"><font color="#888888"><div>Lang.</div>
</font></span></blockquote></div><br></div></div>