<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 --- - "Alignment is not a power of two!" assertion failed in llvm::BumpPtrAllocator::Allocate()"
   href="http://llvm.org/bugs/show_bug.cgi?id=17048">17048</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>"Alignment is not a power of two!" assertion failed in llvm::BumpPtrAllocator::Allocate()
          </td>
        </tr>

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

        <tr>
          <th>Version</th>
          <td>3.3
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>Other
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>FreeBSD
          </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>peter@rulingia.com
          </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>Whilst compiling the following code on FreeBSD 10-CURRENT/arm (Raspberry-Pi)
with the specified command line, I get an "alignment is not a power of two"
assertion failure.

$ cat <<E*O*F > /tmp/test.i
extern void __stack_chk_fail (void);

void
__attribute__((visibility ("hidden")))
__stack_chk_fail_local (void)
{
  __stack_chk_fail ();
}
E*O*F
$ /a/obj/usr/src/tmp/usr/bin/clang -cc1 -triple armv6--freebsd10.0-gnueabi -S
-disable-free -main-file-name ssp-local.c -mrelocation-model pic -pic-level 2
-mdisable-fp-elim -mconstructor-aliases -target-abi aapcs-linux -target-cpu
arm1136jf-s -msoft-float -mfloat-abi soft -target-feature +soft-float
-target-feature +soft-float-abi -target-feature -neon -g -coverage-file
/tmp/test.s -O2 -std=gnu99 -fno-dwarf-directory-asm -fdebug-compilation-dir
/usr/obj/usr/src/gnu/lib/libssp/libssp_nonshared -ferror-limit 19
-fmessage-length 168 -fvisibility hidden -mstackrealign -fno-signed-char
-fobjc-runtime=gnustep -fobjc-default-synthesize-properties
-fdiagnostics-show-option -fcolor-diagnostics -backend-option -vectorize-loops
-o /tmp/test.s -x c /tmp/test.i
Assertion failed: (Alignment && (Alignment & (Alignment - 1)) == 0 &&
"Alignment is not a power of two!"), function AlignPtr, file
/usr/src/lib/clang/libllvmsupport/../../../contrib/llvm/lib/Support/Allocator.cpp,
line 38.
Stack dump:
0.      Program arguments: /a/obj/usr/src/tmp/usr/bin/clang -cc1 -triple
armv6--freebsd10.0-gnueabi -S -disable-free -main-file-name ssp-local.c
-mrelocation-model pic -pic-level 2 -mdisable-fp-elim -mconstructor-aliases
-target-abi aapcs-linux -target-cpu arm1136jf-s -msoft-float -mfloat-abi soft
-target-feature +soft-float -target-feature +soft-float-abi -target-feature
-neon -g -coverage-file /tmp/test.s -O2 -std=gnu99 -fno-dwarf-directory-asm
-fdebug-compilation-dir /usr/obj/usr/src/gnu/lib/libssp/libssp_nonshared
-ferror-limit 19 -fmessage-length 168 -fvisibility hidden -mstackrealign
-fno-signed-char -fobjc-runtime=gnustep -fobjc-default-synthesize-properties
-fdiagnostics-show-option -fcolor-diagnostics -backend-option -vectorize-loops
-o /tmp/test.s -x c /tmp/test.i 
1.      <eof> parser at end of file
Abort (core dumped)
$ /a/obj/usr/src/tmp/usr/bin/clang --version
FreeBSD clang version 3.3 (tags/RELEASE_33/final 183502) 20130610
Target: armv6--freebsd10.0-gnueabi
Thread model: posix
$

When run within gdb, the backtrace is:
#0  0x01f7b50c in __assert ()
#1  0x01eaf9bc in llvm::BumpPtrAllocator::AlignPtr (Ptr=0x26 <Error reading
address 0x26: Bad address>, Alignment=37334412)
    at
/usr/src/lib/clang/libllvmsupport/../../../contrib/llvm/lib/Support/Allocator.cpp:37
#2  0x01eafa24 in llvm::BumpPtrAllocator::Allocate (this=0x22848768, Size=14,
Alignment=3)
    at
/usr/src/lib/clang/libllvmsupport/../../../contrib/llvm/lib/Support/Allocator.cpp:102
#3  0x00463540 in clang::CodeGen::CGDebugInfo::CreateCompileUnit
(this=0x22848600) at Allocator.h:163
#4  0x00463bb4 in CGDebugInfo (this=0x22848600, CGM=<value optimized out>)
    at
/usr/src/lib/clang/libclangcodegen/../../../contrib/llvm/tools/clang/lib/CodeGen/CGDebugInfo.cpp:45
#5  0x002a54f8 in CodeGenModule (this=0x2284fb00, C=@0x22876000,
CGO=@0x2287b094, M=@0x22803100, TD=@0x2283d300, diags=@0x22824300)
    at
/usr/src/lib/clang/libclangcodegen/../../../contrib/llvm/tools/clang/lib/CodeGen/CodeGenModule.cpp:127
#6  0x002a0748 in Initialize (this=0x2287b080, Context=@0x22876000)
    at
/usr/src/lib/clang/libclangcodegen/../../../contrib/llvm/tools/clang/lib/CodeGen/ModuleBuilder.cpp:60
#7  0x0029c930 in clang::BackendConsumer::Initialize (this=0x22805100,
Ctx=@0x22876000)
    at
/usr/src/lib/clang/libclangcodegen/../../../contrib/llvm/tools/clang/lib/CodeGen/CodeGenAction.cpp:89
#8  0x00a2fb54 in clang::Sema::Initialize (this=0x22886e00) at
/usr/src/lib/clang/libclangsema/../../../contrib/llvm/tools/clang/lib/Sema/Sema.cpp:120
#9  0x004d1f50 in $a () at
/usr/src/lib/clang/libclangparse/../../../contrib/llvm/tools/clang/lib/Parse/Parser.cpp:522
#10 0x004d1f50 in $a () at
/usr/src/lib/clang/libclangparse/../../../contrib/llvm/tools/clang/lib/Parse/Parser.cpp:522</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>