aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorTristan Gingold <tgingold@free.fr>2019-11-12 20:19:57 +0100
committerTristan Gingold <tgingold@free.fr>2019-11-12 20:36:04 +0100
commita4a587d729314a8741b72284f624f167fa675062 (patch)
treec67881d89b754506783e6bb13c47c4fc7297967c /src
parentb4490abb58f7a4d1f13900bd3a6c39f64d4dab7f (diff)
downloadghdl-a4a587d729314a8741b72284f624f167fa675062.tar.gz
ghdl-a4a587d729314a8741b72284f624f167fa675062.tar.bz2
ghdl-a4a587d729314a8741b72284f624f167fa675062.zip
synth-oper: handle const substraction.
Diffstat (limited to 'src')
-rw-r--r--src/synth/synth-oper.adb4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/synth/synth-oper.adb b/src/synth/synth-oper.adb
index d98e925a4..07bcc7dbc 100644
--- a/src/synth/synth-oper.adb
+++ b/src/synth/synth-oper.adb
@@ -733,9 +733,9 @@ package body Synth.Oper is
return Synth_Int_Dyadic (Id_Add);
end if;
when Iir_Predefined_Integer_Minus =>
- if Is_Const (Left) and then Is_Const (Right) then
+ if Is_Const_Val (Left) and then Is_Const_Val (Right) then
return Create_Value_Discrete
- (Left.Scal - Right.Scal,
+ (Get_Const_Discrete (Left) - Get_Const_Discrete (Right),
Get_Value_Type (Syn_Inst, Get_Type (Expr)));
else
return Synth_Int_Dyadic (Id_Sub);