<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 --- - problem with long long bitfield"
   href="http://llvm.org/bugs/show_bug.cgi?id=17299">17299</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>problem with long long bitfield
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>clang
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>3.2
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>PC
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>Linux
          </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>unassignedclangbugs@nondot.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>yflelion@hotmail.fr
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvmbugs@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=11245" name="attach_11245" title="problem with long long bitfield">attachment 11245</a> <a href="attachment.cgi?id=11245&action=edit" title="problem with long long bitfield">[details]</a></span>
problem with long long bitfield

Hello,

I find that there is a problem when a bitfield of size greater than 32 bits are
used (with a long long), which is not in the ansi c (although there is no error
message or warning when it is used).

The problem arises when we take for example a 40-bit bitfield, and we shift it
to the left by 32(the result is 64-bit instead of 40), in contrast to what gcc
does.

In the attached file foo is equal to 0 with gcc (which seems the most correct)
and foo equals 0x10000000000 with clang.

In attached file you can find the example I used.

compilers used for comparison are:
clang: v3.2 (final tags/RELEASE_32)
             Target: x86_64-unknown-linux-gnu
             Thread model: posix
gcc (Ubuntu / Linaro 4.6.3-lubuntu5) 4.6.3

Thanks in advance for your help.

Best Regards,

Youssef Fahmi.</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>