diff options
author | Tristan Gingold <tgingold@free.fr> | 2019-09-03 06:01:56 +0200 |
---|---|---|
committer | Tristan Gingold <tgingold@free.fr> | 2019-09-03 06:33:39 +0200 |
commit | dac322e43b97e0d3bfd9cdf0e98f1a7c458501cb (patch) | |
tree | 6c703ed50ed33ac0fe00c3377bdf795d21f26c8c /src/synth/synth-expr.adb | |
parent | 473bc44fdeee10d3d3de650a1f76af83c1aa19ce (diff) | |
download | ghdl-dac322e43b97e0d3bfd9cdf0e98f1a7c458501cb.tar.gz ghdl-dac322e43b97e0d3bfd9cdf0e98f1a7c458501cb.tar.bz2 ghdl-dac322e43b97e0d3bfd9cdf0e98f1a7c458501cb.zip |
synth: subtype conversion before compare.
Diffstat (limited to 'src/synth/synth-expr.adb')
-rw-r--r-- | src/synth/synth-expr.adb | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/synth/synth-expr.adb b/src/synth/synth-expr.adb index 8320f2897..bfaef8f17 100644 --- a/src/synth/synth-expr.adb +++ b/src/synth/synth-expr.adb @@ -946,9 +946,14 @@ package body Synth.Expr is function Synth_Compare (Id : Compare_Module_Id) return Value_Acc is N : Net; + L, R : Value_Acc; + Typ : Type_Acc; begin - N := Build_Compare (Build_Context, Id, - Get_Net (Left), Get_Net (Right)); + pragma Assert (Left_Type = Right_Type); + Typ := Get_Value_Type (Syn_Inst, Left_Type); + L := Synth_Subtype_Conversion (Left, Typ, Expr); + R := Synth_Subtype_Conversion (Right, Typ, Expr); + N := Build_Compare (Build_Context, Id, Get_Net (L), Get_Net (R)); Set_Location (N, Expr); return Create_Value_Net (N, Boolean_Type); end Synth_Compare; |