jacobly0 / llvm-project

This fork of the canonical git mirror of the LLVM subversion repository adds (e)Z80 targets. Please refer to the wiki for important build instructions.
https://github.com/jacobly0/llvm-project/wiki
123 stars 15 forks source link

va_copy is unimplemented #32

Closed parisseb closed 1 year ago

parisseb commented 1 year ago

While trying to port a custom version of USTL, I got a compiler fatal error. Source here: https://www-fourier.univ-grenoble-alpes.fr/~parisse/ti/ustl_compiler_bug.tgz (beware, I replaced the CPP_EXTENSION from cpp to cc in CEdev/meta/makefile.mk) (Nothing urgent, I found a workaround by definining VA_COPY to 0 in ustl/config.h) Error log:...

[compiling] src/ustring.cc
In file included from src/ustring.cc:6:
In file included from ustl/ustring.h:7:
In file included from ustl/memblock.h:7:
In file included from ustl/memlink.h:8:
In file included from ustl/ualgo.h:9:
In file included from ustl/umemory.h:7:
ustl/unew.h:122:1: warning: replacement function 'operator new' cannot be declared 'inline' [-Winline-new-delete]
inline void* operator new (size_t n) USTL_THROW (std::bad_alloc)        { return (tmalloc (n)); }
^
ustl/unew.h:123:1: warning: replacement function 'operator new[]' cannot be declared 'inline' [-Winline-new-delete]
inline void* operator new[] (size_t n) USTL_THROW (std::bad_alloc)      { return (tmalloc (n)); }
^
ustl/unew.h:124:1: warning: replacement function 'operator delete' cannot be declared 'inline' [-Winline-new-delete]
inline void  operator delete (void* p)                          { nfree (p); }
^
ustl/unew.h:125:1: warning: replacement function 'operator delete[]' cannot be declared 'inline' [-Winline-new-delete]
inline void  operator delete[] (void* p)                        { nfree (p); }
^
In file included from src/ustring.cc:6:
In file included from ustl/ustring.h:8:
ustl/utf8.h:47:43: warning: for loop has empty body [-Wempty-body]
        for (n = 0; c_Bounds[n++] < uint32_t(v););
                                                 ^
ustl/utf8.h:47:43: note: put the semicolon on a separate line to silence this warning
ustl/utf8.h:184:2: warning: 'register' storage class specifier is deprecated and incompatible with C++17 [-Wdeprecated-register]
        register wchar_t shift = nBytes * 6;
        ^~~~~~~~~
In file included from src/ustring.cc:6:
In file included from ustl/ustring.h:7:
In file included from ustl/memblock.h:7:
In file included from ustl/memlink.h:7:
In file included from ustl/cmemlink.h:7:
In file included from ustl/ualgobase.h:7:
ustl/uutility.h:77:15: warning: comparison of integers of different signs: 'const int' and 'const unsigned int' [-Wsign-compare]
    return (b < a ? a : b);
            ~ ^ ~
ustl/ustring.h:282:24: note: in instantiation of function template specialization 'ustl::max<unsigned int, int>' requested here
    fill_n (iat(oldn), max(ssize_t(n-oldn),0), c);
                       ^
In file included from src/ustring.cc:8:
ustl/mostream.h:282:51: warning: unused parameter 'v' [-Wunused-parameter]
inline ostream& operator<< (ostream& os, const T& v) {
                                                  ^
8 warnings generated.
[lto opt] obj/lto.bc
fatal error: error in backend: unable to legalize instruction: G_INTRINSIC_W_SIDE_EFFECTS intrinsic(@llvm.va_copy), %7:_(p0), %6:_(p0) (in function: _ZN4ustl6string7vformatEPKcPc)
PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace, preprocessed source, and associated run script.
Stack dump:
0.  Program arguments: /home/parisse/CEdev/bin/ez80-clang -S -mllvm -profile-guided-section-prefix=false -Wall -Wextra -Oz -DTICE /home/parisse/CEdev/examples/ustl/obj/lto.bc -o /home/parisse/CEdev/examples/ustl/obj/lto.src
1.  Code generation
2.  Running pass 'Function Pass Manager' on module '/home/parisse/CEdev/examples/ustl/obj/lto.bc'.
3.  Running pass 'Legalizer' on function '@_ZN4ustl6string7vformatEPKcPc'
Stack dump without symbol names (ensure you have llvm-symbolizer in your PATH or set the environment var `LLVM_SYMBOLIZER_PATH` to point to it):
/home/parisse/CEdev/bin/ez80-clang(_ZN4llvm3sys15PrintStackTraceERNS_11raw_ostreamEi+0x23)[0x201d1e3]
/home/parisse/CEdev/bin/ez80-clang(_ZN4llvm3sys17RunSignalHandlersEv+0xee)[0x201b10e]
/home/parisse/CEdev/bin/ez80-clang(_ZN4llvm3sys15CleanupOnSignalEm+0xdd)[0x201c70d]
/home/parisse/CEdev/bin/ez80-clang[0x1f94e2a]
/home/parisse/CEdev/bin/ez80-clang[0x1f94dcb]
/home/parisse/CEdev/bin/ez80-clang(_ZN4llvm3sys7Process4ExitEib+0x27)[0x20174c7]
/home/parisse/CEdev/bin/ez80-clang[0x11d0dc2]
/home/parisse/CEdev/bin/ez80-clang(_ZN4llvm18report_fatal_errorERKNS_5TwineEb+0x128)[0x1f98a38]
/home/parisse/CEdev/bin/ez80-clang[0x2de4fa4]
/home/parisse/CEdev/bin/ez80-clang(_ZN4llvm18reportGISelFailureERNS_15MachineFunctionERKNS_16TargetPassConfigERNS_32MachineOptimizationRemarkEmitterEPKcNS_9StringRefERKNS_12MachineInstrE+0x2fd)[0x2de52cd]
/home/parisse/CEdev/bin/ez80-clang(_ZN4llvm9Legalizer20runOnMachineFunctionERNS_15MachineFunctionE+0x355)[0x2d8d175]
/home/parisse/CEdev/bin/ez80-clang(_ZN4llvm19MachineFunctionPass13runOnFunctionERNS_8FunctionE+0x10e)[0x15957ee]
/home/parisse/CEdev/bin/ez80-clang(_ZN4llvm13FPPassManager13runOnFunctionERNS_8FunctionE+0x39d)[0x1959a8d]
/home/parisse/CEdev/bin/ez80-clang(_ZN4llvm13FPPassManager11runOnModuleERNS_6ModuleE+0x33)[0x195f703]
/home/parisse/CEdev/bin/ez80-clang(_ZN4llvm6legacy15PassManagerImpl3runERNS_6ModuleE+0x3cf)[0x195a0cf]
/home/parisse/CEdev/bin/ez80-clang(_ZN5clang17EmitBackendOutputERNS_17DiagnosticsEngineERKNS_19HeaderSearchOptionsERKNS_14CodeGenOptionsERKNS_13TargetOptionsERKNS_11LangOptionsEN4llvm9StringRefEPNSE_6ModuleENS_13BackendActionESt10unique_ptrINSE_17raw_pwrite_streamESt14default_deleteISK_EE+0x1bf4)[0x229d914]
/home/parisse/CEdev/bin/ez80-clang(_ZN5clang13CodeGenAction13ExecuteActionEv+0x75e)[0x2b0526e]
/home/parisse/CEdev/bin/ez80-clang(_ZN5clang14FrontendAction7ExecuteEv+0x57)[0x2a592a7]
/home/parisse/CEdev/bin/ez80-clang(_ZN5clang16CompilerInstance13ExecuteActionERNS_14FrontendActionE+0x346)[0x29d0aa6]
/home/parisse/CEdev/bin/ez80-clang(_ZN5clang25ExecuteCompilerInvocationEPNS_16CompilerInstanceE+0x27b)[0x2b00c6b]
/home/parisse/CEdev/bin/ez80-clang(_Z8cc1_mainN4llvm8ArrayRefIPKcEES2_Pv+0xad8)[0x11d0a78]
/home/parisse/CEdev/bin/ez80-clang[0x11cebab]
/home/parisse/CEdev/bin/ez80-clang[0x2858a42]
/home/parisse/CEdev/bin/ez80-clang(_ZN4llvm20CrashRecoveryContext9RunSafelyENS_12function_refIFvvEEE+0xdd)[0x1f94dad]
/home/parisse/CEdev/bin/ez80-clang(_ZNK5clang6driver10CC1Command7ExecuteEN4llvm8ArrayRefINS2_8OptionalINS2_9StringRefEEEEEPNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEPb+0x134)[0x2858574]
/home/parisse/CEdev/bin/ez80-clang(_ZNK5clang6driver11Compilation14ExecuteCommandERKNS0_7CommandERPS3_+0x1a4)[0x281bae4]
/home/parisse/CEdev/bin/ez80-clang(_ZNK5clang6driver11Compilation11ExecuteJobsERKNS0_7JobListERN4llvm15SmallVectorImplISt4pairIiPKNS0_7CommandEEEE+0x77)[0x281bf77]
/home/parisse/CEdev/bin/ez80-clang(_ZN5clang6driver6Driver18ExecuteCompilationERNS0_11CompilationERN4llvm15SmallVectorImplISt4pairIiPKNS0_7CommandEEEE+0x188)[0x28386f8]
/home/parisse/CEdev/bin/ez80-clang(main+0x2737)[0x11ce2b7]
/lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xea)[0x7f7c4b5edd0a]
/home/parisse/CEdev/bin/ez80-clang(_start+0x2e)[0x11cb8ae]
ez80-clang: error: clang frontend command failed with exit code 70 (use -v to see invocation)
clang version 15.0.0 (https://github.com/jacobly0/llvm-project 6d9aa7a16db70f3d02ae304b08d4a03011281fef)
Target: ez80
Thread model: posix
InstalledDir: /home/parisse/CEdev/bin
ez80-clang: note: diagnostic msg: Error generating preprocessed source(s) - no preprocessable inputs.
make: *** [/home/parisse/CEdev/meta/makefile.mk:329 : obj/lto.src] Erreur 1