this code :
use Inline C => Config => BUILD_NOISY => 1; use Inline C => << 'EOC'; void inc_refcnt(SV * sv ) { SvREFCNT_inc(sv); } SV * get_refcnt(SV * sv) { return newSVuv(svREFCNT(sv)); } EOC my $globalVAR = 1; my $refCNT; if ( 1 ) { $refCNT = get_refcnt($globalVAR); $globalVAR++; inc_refcnt($globalVAR); $refCNT = get_refcnt($globalVAR); } else { die; }
resulted in :
/tmp/ccPL0xed.s: Assembler messages: /tmp/ccPL0xed.s:10: Error: `8(%rdi)' is not a valid 32 bit base/index +expression /tmp/ccPL0xed.s:25: Error: suffix or operands invalid for `movslq' /tmp/ccPL0xed.s:43: Error: `8(%rsp)' is not a valid 32 bit base/index +expression
and the <>.xs (as well as the <>.c) file looks fine. how does one debug assembler errors?

In reply to Inline C : assembler errors! by Anonymous Monk

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.