Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

An internal error occurred when using clang 12 or 13 #3148

Closed
kuopinghsu opened this issue Sep 25, 2021 · 2 comments
Closed

An internal error occurred when using clang 12 or 13 #3148

kuopinghsu opened this issue Sep 25, 2021 · 2 comments
Labels
new New issue not seen by maintainers

Comments

@kuopinghsu
Copy link

Here is the sample Verilog code.

module test(
    input           clk,
    input           resetb,
    input           stall,
    input    [ 4:0] sel,
    input    [31:0] datain
    );

reg [31: 0] regs [31: 0];
integer i;

always @(posedge clk or negedge resetb) begin
    if (!resetb) begin
        for(i = 0; i <= 31; i = i + 1) regs[i] <= 32'h0;
    end else if (!stall) begin
        regs[sel] <= datain;
    end
end

endmodule

If I use the following command to build Verilator with clang 12 or 13

CC=clang CXX=clang++ ./configure && make install

I got the following internal error

$ verilator -cc test.v
%Error: Verilator internal fault, sorry. Suggest trying --debug --gdbbt

If I build Verilator with clang 11, there is no issue.

@kuopinghsu kuopinghsu added the new New issue not seen by maintainers label Sep 25, 2021
wsnyder added a commit that referenced this issue Sep 25, 2021
@wsnyder
Copy link
Member

wsnyder commented Sep 25, 2021

Well clang made this one annoying, there was a call to "nodep->debugTreeChange" and although debugTreeChange was an empty function because it's illegal to call members on a null nodep, clang optimized away a later nullptr compare.

Looking for other similar issues... will close if I don't find any.

@wsnyder
Copy link
Member

wsnyder commented Sep 25, 2021

All tests pass.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
new New issue not seen by maintainers
Projects
None yet
Development

No branches or pull requests

2 participants