File: psl-disable-incorrect-optimization

package info (click to toggle)
ghdl 2.0.0%2Bdfsg-6.2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 72,852 kB
  • sloc: ada: 238,924; vhdl: 196,551; ansic: 24,457; python: 17,483; sh: 11,399; cpp: 2,283; makefile: 1,440; pascal: 516; exp: 40; asm: 25
file content (31 lines) | stat: -rw-r--r-- 1,087 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
Description: psl-build.adb: disable incorrect optimization.  Fix #2157
Author: Tristan Gingold <tgingold@free.fr>
Origin: upstream, https://github.com/ghdl/ghdl/commit/7edca40761c6f87878367d53037a5a0dea2117ef
Last-Update: 2023-01-04
---
This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
--- a/src/psl/psl-build.adb
+++ b/src/psl/psl-build.adb
@@ -308,7 +308,10 @@
       Eps := Get_Epsilon_NFA (L) or Get_Epsilon_NFA (R);
 
       --  Optimize [*0] | R.
-      if Start_L = Final_L
+      --  TODO: this was not valid if there is an edge from Start(R)
+      --  to Start(R), like: {[*0] | {d[*]; e}}
+      if False
+        and then Start_L = Final_L
         and then Get_First_Src_Edge (Start_L) = No_Edge
       then
          if Start_R /= Final_R then
--- a/src/psl/psl-build.ads
+++ b/src/psl/psl-build.ads
@@ -17,7 +17,7 @@
 with PSL.Nodes; use PSL.Nodes;
 
 package PSL.Build is
-   Optimize_Final : Boolean := True;
+   Optimize_Final : constant Boolean := True;
 
    function Build_SERE_FA (N : Node) return NFA;
    function Build_FA (N : Node) return NFA;