<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<meta name="Generator" content="Microsoft Exchange Server">
<!-- converted from rtf -->
<style><!-- .EmailQuote { margin-left: 1pt; padding-left: 4pt; border-left: #800000 2px solid; } --></style>
</head>
<body>
<font face="Arial, sans-serif" size="3">
<div> </div>
<div><font size="2">Hi,</font></div>
<div><font size="2"> </font></div>
<div><font size="2">I'm having an issue with subregisters on my target.</font></div>
<div><font size="2"> </font></div>
<div><font size="2">With a pseudo that writes to a 32 bit reg:</font></div>
<div><font size="2"> </font></div>
<div><font size="2">        %vreg20<def> = toHi16_low0_pseudo %vreg2; reg32:%vreg20 hi16:%vreg2</font></div>
<div><font size="2"> </font></div>
<div><font size="2">expands to </font></div>
<div><font size="2"> </font></div>
<div><font size="2">        %vreg2<def> = COPY %a2h; hi16:%vreg2</font></div>
<div><font size="2">        %vreg43<def> = mov 0, pred:0, pred:%noreg, %ac0<imp-use>, %ac1<imp-use>; lo16:%vreg43</font></div>
<div><font size="2">        %vreg20<def> = REG_SEQUENCE %vreg2, hi16, %vreg43, lo16; reg32:%vreg20 hi16:%vreg2 lo16:%vreg43</font></div>
<div><font size="2"> </font></div>
<div><font size="2">Becomes</font></div>
<div><font size="2"> </font></div>
<div><font size="2">16L             %vreg20:hi16<def,undef> = COPY %a2h<kill>, %vreg20<imp-def>; reg32:%vreg20</font></div>
<div><font size="2">368L            %vreg20:lo16<def> = mov 0, pred:0, pred:%noreg, %ac0<imp-use>, %ac1<imp-use>; reg32:%vreg20</font></div>
<div><font size="2"> </font></div>
<div><font size="2">Becomes</font></div>
<div><font size="2"> </font></div>
<div><font size="2"> Live Ins: %a0h %a1_32 %a2h %a3_32</font></div>
<div><font size="2">        ... (COPY coalesced as a2h is live in)</font></div>
<div><font size="2">        %a2l<def> = mov 0, pred:0, pred:%noreg, %ac0<imp-use>, %ac1<imp-use>, %a2_32<imp-use></font></div>
<div><font size="2"> </font></div>
<div><font size="2">results in:</font></div>
<div><font size="2"> </font></div>
<div><font size="2">** Bad machine code: Using an undefined physical register ***</font></div>
<div><font size="2">- function:    lfixedconv8</font></div>
<div><font size="2">- basic block:  0x91a1940 (BB#0)</font></div>
<div><font size="2">- instruction: %a2l<def> = mov 0, pred:0, pred:%noreg, %ac0<imp-use>, %ac1<imp-use>, %a2_32<imp-use></font></div>
<div><font size="2">- operand 6:   %a2_32<imp-use></font></div>
<div><font size="2"> </font></div>
<div><font size="2"> </font></div>
<div><font size="2">I cannot quite figure what's wrong here - the a2_32<imp-use> operand was added by the VirtualRegRewriter, because the partial def was not marked undef. The reason for this was that the LiveIntervalsAnalysis pass cleaned up after REG_SEQUENCE
lowering by making the first occurence - when the interval for the reg was empty and thus created - an <def,undef>, but then it does not do the same for the other subreg, as at that time the interval for the reg is not empty.</font></div>
<div><font size="2"> </font></div>
<div><font size="2">Can anyone say what went wrong? </font></div>
<div><font size="2"> </font></div>
<div><font size="2">Thanks,</font></div>
<div><font size="2"> </font></div>
<div><font size="2">Jonas</font></div>
<div><font size="2"> </font></div>
</font>
</body>
</html>