[prev in list] [next in list] [prev in thread] [next in thread] 

List:       llvm-bugs
Subject:    [LLVMbugs] [Bug 19909] New: va_arg fails with __int128
From:       bugzilla-daemon () llvm ! org
Date:       2014-05-31 22:58:27
Message-ID: bug-19909-206 () http ! llvm ! org/bugs/
[Download RAW message or body]

--1401577108.3eecF10.4210
Date: Sat, 31 May 2014 17:58:28 -0500
MIME-Version: 1.0
Content-Type: text/plain; charset="UTF-8"

http://llvm.org/bugs/show_bug.cgi?id=19909

            Bug ID: 19909
           Summary: va_arg fails with __int128
           Product: new-bugs
           Version: trunk
          Hardware: All
                OS: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: new bugs
          Assignee: unassignedbugs@nondot.org
          Reporter: nenad@intrepid.com
                CC: llvmbugs@cs.uiuc.edu
    Classification: Unclassified

Created attachment 12583
  --> http://llvm.org/bugs/attachment.cgi?id=12583&action=edit
Demonstrate __int128 va_arg failure

The attached example fails on Clang/LLVM trunk (or 3.4 or Apple 3.4) and passes
when compiled with gcc 4.8.2.  The code simple tries to pass multiple __int128
after two ints and a pointer.  I debugged it a bit and it seems that the
"overflow_arg_area" pointer in va_list is wrong by 8 bytes, which might
indicate some alignment problem. 

I also checked how __int128 is passed to the function.  It seems that Clang is
capable of splitting the __int128 where lower part is passed in a register and
upper part on the stack.  GCC does not split __int128 if it does not have 2
registers available.  This might explain the wrong 8 bytes offset for the
"overflow_arg_area" as va_start does not adjust for the split register.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

--1401577108.3eecF10.4210
Date: Sat, 31 May 2014 17:58:28 -0500
MIME-Version: 1.0
Content-Type: text/html; charset="UTF-8"

<html>
    <head>
      <base href="http://llvm.org/bugs/" />
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW --- - va_arg fails with __int128"
   href="http://llvm.org/bugs/show_bug.cgi?id=19909">19909</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>va_arg fails with __int128
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>new-bugs
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>trunk
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>All
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>All
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>normal
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>new bugs
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>unassignedbugs&#64;nondot.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>nenad&#64;intrepid.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvmbugs&#64;cs.uiuc.edu
          </td>
        </tr>

        <tr>
          <th>Classification</th>
          <td>Unclassified
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Created <span class=""><a href="attachment.cgi?id=12583" \
name="attach_12583" title="Demonstrate __int128 va_arg failure">attachment 12583</a> \
<a href="attachment.cgi?id=12583&amp;action=edit" title="Demonstrate __int128 va_arg \
failure">[details]</a></span> Demonstrate __int128 va_arg failure

The attached example fails on Clang/LLVM trunk (or 3.4 or Apple 3.4) and passes
when compiled with gcc 4.8.2.  The code simple tries to pass multiple __int128
after two ints and a pointer.  I debugged it a bit and it seems that the
&quot;overflow_arg_area&quot; pointer in va_list is wrong by 8 bytes, which might
indicate some alignment problem. 

I also checked how __int128 is passed to the function.  It seems that Clang is
capable of splitting the __int128 where lower part is passed in a register and
upper part on the stack.  GCC does not split __int128 if it does not have 2
registers available.  This might explain the wrong 8 bytes offset for the
&quot;overflow_arg_area&quot; as va_start does not adjust for the split \
register.</pre>  </div>
      </p>
      <hr>
      <span>You are receiving this mail because:</span>
      
      <ul>
          <li>You are on the CC list for the bug.</li>
      </ul>
    </body>
</html>

--1401577108.3eecF10.4210--



_______________________________________________
LLVMbugs mailing list
LLVMbugs@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic