https://bugs.llvm.org/show_bug.cgi?id=42420

            Bug ID: 42420
           Summary: error in backend: Functions with 'no-prototype'
                    attribute should not have params
           Product: new-bugs
           Version: unspecified
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: new bugs
          Assignee: [email protected]
          Reporter: [email protected]
                CC: [email protected], [email protected]

Created attachment 22150
  --> https://bugs.llvm.org/attachment.cgi?id=22150&action=edit
the run script

error in backend: Functions with 'no-prototype' attribute should not have
params: make_foo

to reproduce:
emcc foo.c

foo.c:
        struct foo {
                int bar, baz;
        };

        struct foo make_foo();

        void test()
        {
                struct foo foo = make_foo();
        }

expected behaviour:
successfull compilation

actual behaviour:
backend error

Emscripten version: 1.38.34
clang version: 9.0.0
system: ArchLinux

the error doesn't happen if foo only has one int or if make_foo is defined
in the same translation unit.
the code compiles fine if the target is x86_64, but fails when targeting
webassembly


emcc output:
fatal error: error in backend: Functions with 'no-prototype' attribute should
not have params: make_foo
clang-9: error: clang frontend command failed with exit code 70 (use -v to see
invocation)
clang version 9.0.0 (/startdir/llvm-project
58dbe47b9c64bafcc8b430e8bfea92f7fe641c8e)
Target: wasm32-unknown-emscripten
Thread model: posix
InstalledDir: /usr/lib/emscripten-llvm
clang-9: note: diagnostic msg: PLEASE submit a bug report to
https://bugs.llvm.org/ and include the crash backtrace, preprocessed source,
and associated run script.
clang-9: note: diagnostic msg:
********************

PLEASE ATTACH THE FOLLOWING FILES TO THE BUG REPORT:
Preprocessed source(s) and associated run script(s) are located at:
clang-9: note: diagnostic msg: /tmp/foo-998150.c
clang-9: note: diagnostic msg: /tmp/foo-998150.sh
clang-9: note: diagnostic msg:

********************
shared:ERROR: compiler frontend failed to generate LLVM bitcode, halting

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to