Commits

Iain Buclaw committed 0d65aed

Issue #252 - Error: suffix or operands invalid for `jc'

  • Participants
  • Parent commits c72727f

Comments (0)

Files changed (4)

File d/asmstmt.cc

     Arg_Memory,
     Arg_FrameRelative,
     Arg_LocalSize,
+    Arg_Label,
     Arg_Dollar
 };
 
                 arg_val = irs->integerConstant(var_frame_offset);
                 cns = i_cns;
                 break;
+            case Arg_Label:
+                /* Just add label, no further processing needed.  */
+                arg_val = irs->getLabelTree((LabelDsymbol *) ((DsymbolExp *) arg->expr)->s);
+                labels.cons(NULL_TREE, arg_val);
+                continue;
             default:
                 gcc_unreachable();
         }

File d/d-asm-i386.h

                                 unsigned lbl_num = ++d_priv_asm_label_serial;
                                 addLabel(lbl_num);
                                 use_star = false;
-                                asmcode->dollarLabel = lbl_num; // could make the dollar label part of the same asm..
+                                // could make the dollar label part of the same asm..
+                                asmcode->dollarLabel = lbl_num;
                             }
                             else if (e->op == TOKdsymbol)
                             {
                                 LabelDsymbol * lbl = (LabelDsymbol *) ((DsymbolExp *) e)->s;
                                 if (! lbl->asmLabelNum)
                                     lbl->asmLabelNum = ++d_priv_asm_label_serial;
-#if D_GCC_VER >= 45
-                                use_star = false;
-                                addOperand("%a", Arg_Pointer, e, asmcode);
-#else
                                 use_star = false;
                                 addLabel(lbl->asmLabelNum);
-#endif
+                                // Push label as argument. Not really emitted.
+                                asmcode->args.push(new AsmArg(Arg_Label, e, Mode_Input));
                             }
                             else if ((decl && decl->isCodeseg()))
                             {   // if function or label
     {
         irs->pushLabel(label);
         irs->doLabel(t_label);
-#if D_GCC_VER < 45
         if (label->asmLabelNum)
             d_expand_priv_asm_label(irs, label->asmLabelNum);
-#endif
         if (irs->isReturnLabel(ident) && func->fensure)
             func->fensure->toIR(irs);
         else if (statement)

File d/d-irstate.cc

 void
 IRBase::pushStatementList()
 {
-    //tree t = alloc_stmt_list ();
-    tree t = make_node (STATEMENT_LIST);
-    TREE_TYPE (t) = void_type_node;
+    tree t = alloc_stmt_list ();
     statementList.push(t);
+    dkeep(t);
 }
 
 tree