+ case state_saw_loc4:
+ d->state = state_wait_loc4;
+ if (*pnbytes != 4)
+ break;
+ if (exp->X_op == O_constant)
+ {
+ /* This is a case which we can optimize. The two symbols being
+ subtracted were in the same frag and the expression was
+ reduced to a constant. We can do the optimization entirely
+ in this function. */
+ if (exp->X_add_number < 0x40)
+ {
+ d->loc4_frag->fr_literal[d->loc4_fix]
+ = DW_CFA_advance_loc | exp->X_add_number;
+ /* No more bytes needed. */
+ return 1;
+ }
+ else if (exp->X_add_number < 0x100)
+ {
+ d->loc4_frag->fr_literal[d->loc4_fix] = DW_CFA_advance_loc1;
+ *pnbytes = 1;
+ }
+ else if (exp->X_add_number < 0x10000)
+ {
+ d->loc4_frag->fr_literal[d->loc4_fix] = DW_CFA_advance_loc2;
+ *pnbytes = 2;
+ }
+ }
+ else if (exp->X_op == O_subtract && d->cie_info.code_alignment == 1)
+ {
+ /* This is a case we can optimize. The expression was not
+ reduced, so we can not finish the optimization until the end
+ of the assembly. We set up a variant frag which we handle
+ later. */
+ frag_var (rs_cfa, 4, 0, 1 << 3, make_expr_symbol (exp),
+ d->loc4_fix, (char *) d->loc4_frag);
+ return 1;
+ }
+ else if ((exp->X_op == O_divide
+ || exp->X_op == O_right_shift)
+ && d->cie_info.code_alignment > 1)
+ {
+ if (exp->X_add_symbol->bsym
+ && exp->X_op_symbol->bsym
+ && exp->X_add_symbol->sy_value.X_op == O_subtract
+ && exp->X_op_symbol->sy_value.X_op == O_constant
+ && ((exp->X_op == O_divide
+ ? exp->X_op_symbol->sy_value.X_add_number
+ : (offsetT) 1 << exp->X_op_symbol->sy_value.X_add_number)
+ == (offsetT) d->cie_info.code_alignment))
+ {
+ /* This is a case we can optimize as well. The expression was
+ not reduced, so we can not finish the optimization until the
+ end of the assembly. We set up a variant frag which we
+ handle later. */
+ frag_var (rs_cfa, 4, 0, d->cie_info.code_alignment << 3,
+ make_expr_symbol (&exp->X_add_symbol->sy_value),
+ d->loc4_fix, (char *) d->loc4_frag);
+ return 1;
+ }
+ }
+ break;