CTSRD-CHERI / clang

DO NOT USE. Use llvm-project instead
Other
9 stars 8 forks source link

"Using an undefined physical register" when compiling cheritest_registers.c #111

Closed arichardson closed 7 years ago

arichardson commented 7 years ago
"/home/alr48/cheri/output-debug/sdk256/bin/clang-3.8" "-cc1" "-triple" "cheri-unknown-freebsd" "-emit-obj" "-disable-free" "-main-file-name" "cheritest_registers.c" "-mrelocation-model" "static" "-mthread-model" "posix" "-mdisable-fp-elim" "-masm-verbose" "-mconstructor-aliases" "-target-feature" "+soft-float" "-target-abi" "n64" "-msoft-float" "-mfloat-abi" "soft" "-mllvm" "-mips-ssection-threshold=0" "-dwarf-column-info" "-debug-info-kind=standalone" "-dwarf-version=2" "-sys-header-deps" "-O2" "-Wsystem-headers" "-Wall" "-Wno-format-y2k" "-W" "-Wno-unused-parameter" "-Wstrict-prototypes" "-Wmissing-prototypes" "-Wpointer-arith" "-Wreturn-type" "-Wcast-qual" "-Wwrite-strings" "-Wswitch" "-Wshadow" "-Wunused-parameter" "-Wcast-align" "-Wchar-subscripts" "-Winline" "-Wnested-externs" "-Wredundant-decls" "-Wold-style-definition" "-Wno-pointer-sign" "-Wmissing-variable-declarations" "-Wthread-safety" "-Wno-empty-body" "-Wno-string-plus-int" "-Wno-unused-const-variable" "-std=gnu99" "-fconst-strings" "-ferror-limit" "19" "-fmessage-length" "0" "-fobjc-runtime=gnustep" "-fdiagnostics-show-option" "-vectorize-loops" "-vectorize-slp" "-cheri-linker" "-x" "c" "/tmp/cheritest_registers-6cbe67.c"           
/home/alr48/cheri/sources/cheribsd/bin/cheritest/cheritest_registers.c:150:57: warning: format specifies type 'uintmax_t' (aka 'unsigned long') but the argument has type 'int' [-Wformat]
                cheritest_failure_errx("otype %jx (expected %jx)", v, 0);
                                                            ~~~       ^
                                                            %x
/home/alr48/cheri/sources/cheribsd/bin/cheritest/cheritest_registers.c:196:57: warning: format specifies type 'uintmax_t' (aka 'unsigned long') but the argument has type 'int' [-Wformat]
                cheritest_failure_errx("otype %jx (expected %jx)", v, 0);
                                                            ~~~       ^
                                                            %x

# Machine code for function test_initregs_stack: Post SSA
Function Live Ins: %T9_64

BB#0: derived from LLVM BB %entry
    Live Ins: %T9_64
        %vreg5<def> = LUi64 <ga:@test_initregs_stack>[TF=14]; GPR64:%vreg5
        %vreg6<def> = DADDu %vreg5, %T9_64; GPR64:%vreg6,%vreg5
        %vreg1<def> = DADDiu %vreg6, <ga:@test_initregs_stack>[TF=15]; GPR64:%vreg1,%vreg6
        DBG_VALUE %A0_64, %noreg, !"ctp", <!221>; line no:235
        %vreg3<def> = LD %vreg1, <ga:@check_initreg_data>[TF=17]; mem:LD8[GOT] GPR64:%vreg3,%vreg1 dbg:/home/alr48/cheri/sources/cheribsd/bin/cheritest/cheritest_registers.c:239:2
        %vreg2<def> = CIncOffset %C11, %ZERO_64; CheriRegs:%vreg2 dbg:/home/alr48/cheri/sources/cheribsd/bin/cheritest/cheritest_registers.c:239:21
        %vreg4<def> = DADDiu %vreg3, <ga:@check_initreg_data>[TF=18]; GPR64:%vreg4,%vreg3 dbg:/home/alr48/cheri/sources/cheribsd/bin/cheritest/cheritest_registers.c:239:2
        ADJCALLSTACKDOWN 0, %SP<imp-def>, %SP<imp-use>; dbg:/home/alr48/cheri/sources/cheribsd/bin/cheritest/cheritest_registers.c:239:2
        %C1<def> = COPY %vreg2; CheriRegs:%vreg2 dbg:/home/alr48/cheri/sources/cheribsd/bin/cheritest/cheritest_registers.c:239:2
        %T9_64<def> = COPY %vreg4; GPR64:%vreg4 dbg:/home/alr48/cheri/sources/cheribsd/bin/cheritest/cheritest_registers.c:239:2
        JALR64Pseudo %T9_64, <regmask %FP %GP %RA %C17 %C18 %C19 %C20 %C21 %C22 %C23 %C24 %D12 %D13 %D14 %D15 %F24 %F25 %F26 %F27 %F28 %F29 %F30 %F31 %FP_64 %F_HI24 %F_HI25 %F_HI26 %F_HI27 %F_HI28 %F_HI29 %F_HI30 %F_HI31 %GP_64 %RA_64 %S0 %S1 %S2 %S3 %S4 %S5 %S6 %S7 %D24_64 %D25_64 %D26_64 %D27_64 %D28_64 %D29_64 %D30_64 %D31_64 %S0_64 %S1_64 %S2_64 %S3_64 %S4_64 %S5_64 %S6_64 %S7_64>, %C1<imp-use,kill>, %SP<imp-def>, ...; dbg:/home/alr48/cheri/sources/cheribsd/bin/cheritest/cheritest_registers.c:239:2
        ADJCALLSTACKUP 0, 0, %SP<imp-def>, %SP<imp-use>; dbg:/home/alr48/cheri/sources/cheribsd/bin/cheritest/cheritest_registers.c:239:2

# End machine code for function test_initregs_stack.

*** Bad machine code: Using an undefined physical register ***
- function:    test_initregs_stack
- basic block: BB#0 entry (0x81911d3e8)
- instruction: %vreg2<def> = CIncOffset- operand 1:   %C11
fatal error: error in backend: Found 1 machine code errors.

Code: https://gist.github.com/RichardsonAlex/9f6918a173492dfcdc389015101519fb

arichardson commented 7 years ago

This no longer appears to happen