mirror of
https://github.com/verilator/verilator.git
synced 2025-01-01 04:07:34 +00:00
Fix error on empty generate with -O0 (#5250).
This commit is contained in:
parent
570e1bc35a
commit
bbb223f217
1
Changes
1
Changes
@ -22,6 +22,7 @@ Verilator 5.027 devel
|
||||
* Fix unknown conversion on queues (#5220). [Alex Solomatnikov]
|
||||
* Fix top-level unpacked structure resets (#5221).
|
||||
* Fix concurrency for mailbox and semaphores (#5222). [Liam Braun]
|
||||
* Fix error on empty generate with -O0 (#5250).
|
||||
|
||||
|
||||
Verilator 5.026 2024-06-15
|
||||
|
@ -356,7 +356,11 @@ class UnrollVisitor final : public VNVisitor {
|
||||
}
|
||||
}
|
||||
if (!newbodysp) { // initp might have effects after the loop
|
||||
newbodysp = initp; // Maybe nullptr
|
||||
if (m_generate && initp) { // GENFOR(ASSIGN(...)) need to move under a new Initial
|
||||
newbodysp = new AstInitial{initp->fileline(), initp};
|
||||
} else {
|
||||
newbodysp = initp; // Maybe nullptr
|
||||
}
|
||||
initp = nullptr;
|
||||
}
|
||||
// Replace the FOR()
|
||||
|
20
test_regress/t/t_genfor_init_o0.pl
Executable file
20
test_regress/t/t_genfor_init_o0.pl
Executable file
@ -0,0 +1,20 @@
|
||||
#!/usr/bin/env perl
|
||||
if (!$::Driver) { use FindBin; exec("$FindBin::Bin/bootstrap.pl", @ARGV, $0); die; }
|
||||
# DESCRIPTION: Verilator: Verilog Test driver/expect definition
|
||||
#
|
||||
# Copyright 2024 by Wilson Snyder. This program is free software; you
|
||||
# can redistribute it and/or modify it under the terms of either the GNU
|
||||
# Lesser General Public License Version 3 or the Perl Artistic License
|
||||
# Version 2.0.
|
||||
# SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0
|
||||
|
||||
scenarios(vlt => 1);
|
||||
|
||||
compile(
|
||||
verilator_flags2 => ['-O0'],
|
||||
make_main => 0,
|
||||
verilator_make_gmake => 0,
|
||||
);
|
||||
|
||||
ok(1);
|
||||
1;
|
10
test_regress/t/t_genfor_init_o0.v
Normal file
10
test_regress/t/t_genfor_init_o0.v
Normal file
@ -0,0 +1,10 @@
|
||||
// DESCRIPTION: Verilator: Verilog Test module
|
||||
//
|
||||
// This file ONLY is placed under the Creative Commons Public Domain, for
|
||||
// any use, without warranty, 2024 by Wilson Snyder.
|
||||
// SPDX-License-Identifier: CC0-1.0
|
||||
|
||||
module t(/*AUTOARG*/);
|
||||
genvar i;
|
||||
for (i = 0; i < 0; i = i + 1) begin end
|
||||
endmodule
|
Loading…
Reference in New Issue
Block a user