[LLVMbugs] [Bug 5930] New: codegen: should support trunc of blockaddress difference

bugzilla-daemon at cs.uiuc.edu bugzilla-daemon at cs.uiuc.edu
Sun Jan 3 03:35:09 PST 2010


           Summary: codegen: should support trunc of blockaddress difference
           Product: new-bugs
           Version: unspecified
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: new bugs
        AssignedTo: unassignedbugs at nondot.org
        ReportedBy: edwintorok at gmail.com
                CC: llvmbugs at cs.uiuc.edu

Compiling the testcase from PR5929 in 64-bit mode crashes codegen:
$ llvm-git/obj/Release/bin/clang x.c
FIXME: Don't support this constant cast expr      
UNREACHABLE executed at
0  clang           0x00000000013b912f
1  clang           0x00000000013b993d
2  libpthread.so.0 0x000000317a40e990
3  libc.so.6       0x0000003179831f55 gsignal + 53
4  libc.so.6       0x0000003179834d90 abort + 384
5  clang           0x000000000139b014
6  clang           0x0000000001018a01
7  clang           0x0000000001018eef
8  clang           0x00000000010196bf
9  clang           0x0000000001018f1e
10 clang           0x0000000000d24b24
11 clang           0x0000000001016b8f
12 clang           0x00000000013495d1
13 clang           0x0000000001349699
14 clang           0x00000000004afcab
15 clang           0x00000000004b05a5
16 clang           0x00000000006a2044
17 clang           0x000000000040d500
18 clang           0x000000000040feb3 main + 1523
19 libc.so.6       0x000000317981eabd __libc_start_main + 253
20 clang           0x000000000040b0e9
Stack dump:
0.      Program arguments: /home/edwin/llvm-git/obj/Release/bin/clang -cc1
-triple x86_64-unknown-linux-gnu -S -disable-free -main-file-name x.c
-mrelocation-model static -mdisable-fp-elim -munwind-tables -target-cpu x86-64
-resource-dir /home/edwin/llvm-git/obj/Release/lib/clang/1.1 -fmessage-length
139 -fgnu-runtime -fdiagnostics-show-option -fcolor-diagnostics -o
/tmp/cc-iydhUp.s -x c x.c
1.      <eof> parser at end of file
2.      Code generation
clang: error: compiler command failed due to signal 6 (use -v to see

Attached is a bitcode testcase, the problem seems to be this constant:
i32 trunc (i64 sub (i64 ptrtoint (i8* blockaddress(@test, %return) to i64), i64
ptrtoint (i8* blockaddress(@test, %return) to i64)) to i32)

Truncating a 64-bit pointer to 32-bit isn't a good thing to do in general,
however both blockaddresses are in the same function, thus the difference can't
overflow a 32-bit number. So LLC shouldn't crash when trying to codegen this.

Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.

More information about the llvm-bugs mailing list