[PATCH, i386, Pointer Bounds Checker 33/x] MPX ABI

Jeff Law law@redhat.com
Wed Sep 24 16:07:00 GMT 2014


On 09/24/14 01:05, Ilya Enkovich wrote:
>> However, we've still got the problem that the RTL you've generated is
>> ill-formed.  If I understand things correctly, the assignments are the
>> result of the call, that should be modeled by having the destination be a
>> PARALLEL as mentioned earlier.
>
> OK. Will try it. BTW call_value_pop patterns have two sets. One for
> returned value and one for stack register. How comes it differs much
> from what I do with bound regs?
The semantics of a PARALLEL are that all the values used in the 
expressions are evaluated, then all the side effects are performed.  So:

(define_insn "*call_pop"
   [(call (mem:QI (match_operand:SI 0 "call_insn_operand" "lmBz"))
          (match_operand 1))
    (set (reg:SI SP_REG)
         (plus:SI (reg:SI SP_REG)
                  (match_operand:SI 2 "immediate_operand" "i")))]
   "!TARGET_64BIT && !SIBLING_CALL_P (insn)"
   "* return ix86_output_call_insn (insn, operands[0]);"
   [(set_attr "type" "call")])

According to the semantics of a PARALLEL would indicate that the 
reference to SP_REG on the RHS of the 2nd assignment expression takes 
the value of SP_REG *prior to the call*.  And those are the semantics we 
depend on.


So in your case the RHS references to BND0_REG and BND1_REG use the 
values *before* the call -- and I don't think that's the semantics you 
want.  You might get away with it because of the UNSPEC wrapping, but 
IMHO, it's still ill-formed RTL.

jeff




More information about the Gcc-patches mailing list