> may_trap_or_fault_p() does the right thing by taking the misalignement > of stack accesses into account on STRICT_ALIGN targets. Would it be a > solution to call that instead may_trap_p() from > haifa-sched.c:may_trap_exp() ?
That wouldn't be the first time that this replacement is done. > I'm not clear why may_trap_p() and may_trap_or_fault_p() are different > functions. And yet there is a lenghty explanation. :-) > When would we want to disallow a trap, but allow a misalignment fault? You use may_trap_p when you're querying the semantical properties of an instruction in a valid program: if it returns true, then the instruction may generate a trap in a valid program. You use may_trap_or_fault_p when you're querying the actual properties of an instruction whatever the context: if it returns true, then the instruction may generate a trap in a valid program or may generate a fault if it appears in a context that isn't appropriate. -- Eric Botcazou