summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--iirs.ads1
-rw-r--r--libraries/std/textio_body.vhdl6
-rw-r--r--ortho/mcode/ortho_code-debug.adb2
-rw-r--r--ortho/mcode/ortho_code-x86-insns.adb9
-rw-r--r--sem_names.adb21
-rw-r--r--translate/ghdldrv/ghdllocal.adb5
-rw-r--r--translate/ghdldrv/ghdlmain.adb11
-rw-r--r--translate/grt/grt-waves.adb2
-rw-r--r--translate/translation.adb53
9 files changed, 69 insertions, 41 deletions
diff --git a/iirs.ads b/iirs.ads
index 8014453..e3bcc41 100644
--- a/iirs.ads
+++ b/iirs.ads
@@ -2517,7 +2517,6 @@ package Iirs is
Iir_Kind_Overload_List, -- used internally by sem_expr.
-- Declarations.
- -- iir_kinds_nonoverloadable_declaration
Iir_Kind_Type_Declaration,
Iir_Kind_Anonymous_Type_Declaration,
Iir_Kind_Subtype_Declaration,
diff --git a/libraries/std/textio_body.vhdl b/libraries/std/textio_body.vhdl
index 441e4d7..1809adf 100644
--- a/libraries/std/textio_body.vhdl
+++ b/libraries/std/textio_body.vhdl
@@ -541,7 +541,7 @@ package body textio is
is
variable nl : line;
begin
- if l'length = 0 then
+ if l = null or l'length = 0 then
good := false;
else
value := l (l'left);
@@ -1169,10 +1169,10 @@ package body textio is
when digits =>
state := decimals;
when others =>
- return;
+ exit;
end case;
when others =>
- return;
+ exit;
end case;
end loop;
diff --git a/ortho/mcode/ortho_code-debug.adb b/ortho/mcode/ortho_code-debug.adb
index 090298a..0f3e01a 100644
--- a/ortho/mcode/ortho_code-debug.adb
+++ b/ortho/mcode/ortho_code-debug.adb
@@ -85,6 +85,8 @@ package body Ortho_Code.Debug is
Flag_Debug_Stat := True;
when 'k' =>
Flag_Debug_Keep := True;
+ when 't' =>
+ Flags.Flag_Type_Name := True;
when others =>
Put_Line (Standard_Error, "unknown debug be flag '" & C & "'");
end case;
diff --git a/ortho/mcode/ortho_code-x86-insns.adb b/ortho/mcode/ortho_code-x86-insns.adb
index 09dfdd7..4278bdc 100644
--- a/ortho/mcode/ortho_code-x86-insns.adb
+++ b/ortho/mcode/ortho_code-x86-insns.adb
@@ -412,11 +412,11 @@ package body Ortho_Code.X86.Insns is
Mode : Mode_Type;
Reg_Orig : O_Reg;
begin
- Orig := Regs (Reg).Stmt;
- if Orig = O_Enode_Null then
+ if Regs (Reg).Num = O_Free then
-- This register was not allocated.
raise Program_Error;
end if;
+ Orig := Regs (Reg).Stmt;
-- Add a spill statement.
Mode := Get_Expr_Mode (Orig);
@@ -638,7 +638,9 @@ package body Ortho_Code.X86.Insns is
return Expr;
end if;
Free_R32 (Reg);
- return Insert_Move (Expr, Alloc_Reg (Dest, Expr, Num));
+ Spill := Insert_Move (Expr, Dest);
+ Alloc_R32 (Dest, Spill, Num);
+ return Spill;
when others =>
Error_Reg ("reload: unhandled dest in R32", Expr, Dest);
end case;
@@ -850,6 +852,7 @@ package body Ortho_Code.X86.Insns is
return N;
end Insert_Intrinsic;
+ -- REG is mandatory: the result of STMT must satisfy the REG constraint.
function Gen_Insn (Stmt : O_Enode; Reg : O_Reg; Pnum : O_Inum)
return O_Enode;
diff --git a/sem_names.adb b/sem_names.adb
index ff0c879..5feaead 100644
--- a/sem_names.adb
+++ b/sem_names.adb
@@ -703,6 +703,7 @@ package body Sem_Names is
Prefix_Type : Iir;
Index_Type : Iir;
Prefix : Iir;
+ Staticness : Iir_Staticness;
begin
-- LRM93 14.1
-- Parameter: A locally static expression of type universal_integer, the
@@ -777,7 +778,19 @@ package body Sem_Names is
-- A globally static array subtype is a constrained array subtype
-- formed by imposing on an unconstrained array type a globally static
-- index constraint.
- Set_Expr_Staticness (Attr, Get_Type_Staticness (Prefix_Type));
+ Staticness := Get_Type_Staticness (Prefix_Type);
+ if Flags.Vhdl_Std = Vhdl_93c
+ and then Get_Kind (Prefix) not in Iir_Kinds_Type_Declaration
+ then
+ -- For 93c:
+ -- if the prefix is a static expression, the staticness of the
+ -- expression may be higher than the staticness of the type
+ -- (eg: generic whose type is an unconstrained array).
+ -- Also consider expression staticness.
+ Staticness := Iir_Staticness'Max (Staticness,
+ Get_Expr_Staticness (Prefix));
+ end if;
+ Set_Expr_Staticness (Attr, Staticness);
end Finish_Sem_Array_Attribute;
procedure Finish_Sem_Scalar_Type_Attribute (Attr : Iir; Param : Iir)
@@ -2102,7 +2115,11 @@ package body Sem_Names is
| Iir_Kind_Slice_Name =>
Error_Msg_Sem ("prefix of user defined attribute cannot be an "
& "object subelement", Attr);
- return Null_Iir;
+ return Error_Mark;
+ when Iir_Kind_Dereference =>
+ Error_Msg_Sem ("prefix of user defined attribute cannot be an "
+ & "anonymous object", Attr);
+ return Error_Mark;
when Iir_Kinds_Object_Declaration
| Iir_Kind_Design_Unit
| Iir_Kind_Type_Declaration
diff --git a/translate/ghdldrv/ghdllocal.adb b/translate/ghdldrv/ghdllocal.adb
index 4a9f62f..9eccdcf 100644
--- a/translate/ghdldrv/ghdllocal.adb
+++ b/translate/ghdldrv/ghdllocal.adb
@@ -149,16 +149,15 @@ package body Ghdllocal is
use Ada.Text_IO;
procedure P (Str : String) renames Put_Line;
begin
- P ("Options:");
+ P ("Main options (try --options-help for details):");
P (" --std=XX Use XX as VHDL standard (87,93c,93,00 or 02)");
P (" --work=NAME Set the name of the WORK library");
P (" -PDIR Add DIR in the library search path");
P (" --workdir=DIR Specify the directory of the WORK library");
P (" --PREFIX=DIR Specify installation prefix");
-
P (" --ieee=NAME Use NAME as ieee library, where name is:");
P (" standard: standard version (default)");
- P (" synopsys, mentor: vendor version (bad)");
+ P (" synopsys, mentor: vendor version (not advised)");
P (" none: do not use a predefined ieee library");
end Disp_Long_Help;
diff --git a/translate/ghdldrv/ghdlmain.adb b/translate/ghdldrv/ghdlmain.adb
index a2eab98..8875279 100644
--- a/translate/ghdldrv/ghdlmain.adb
+++ b/translate/ghdldrv/ghdlmain.adb
@@ -132,9 +132,10 @@ package body Ghdlmain is
C := C.Next;
end loop;
New_Line;
- Put_Line
- ("To display the options of a GHDL program, run your program");
- Put_Line (" with the --help option.");
+ Put_Line ("To display the options of a GHDL program,");
+ Put_Line (" run your programm with the --help option.");
+ Put_Line ("Also see --options-help for analyzer options.");
+ New_Line;
Put_Line ("Please, refer to the GHDL manual for more information.");
Put_Line ("Report bugs on http://gna.org/projects/ghdl");
elsif Args'Length = 1 then
@@ -171,7 +172,7 @@ package body Ghdlmain is
is
pragma Unreferenced (Cmd);
begin
- return "--options-help Disp help for compiler options";
+ return "--options-help Disp help for analyzer options";
end Get_Short_Help;
procedure Perform_Action (Cmd : in out Command_Option_Help;
@@ -352,8 +353,8 @@ package body Ghdlmain is
procedure Register_Commands is
begin
Register_Command (new Command_Help);
- Register_Command (new Command_Option_Help);
Register_Command (new Command_Version);
+ Register_Command (new Command_Option_Help);
end Register_Commands;
end Ghdlmain;
diff --git a/translate/grt/grt-waves.adb b/translate/grt/grt-waves.adb
index bfe4cec..fed4086 100644
--- a/translate/grt/grt-waves.adb
+++ b/translate/grt/grt-waves.adb
@@ -305,7 +305,7 @@ package body Grt.Waves is
-- Called before elaboration.
procedure Wave_Init
is
- Mode : constant String := "wt" & NUL;
+ Mode : constant String := "wb" & NUL;
begin
if Wave_Filename = null then
Wave_Stream := NULL_Stream;
diff --git a/translate/translation.adb b/translate/translation.adb
index 051adc7..330f4a6 100644
--- a/translate/translation.adb
+++ b/translate/translation.adb
@@ -4598,30 +4598,30 @@ package body Translation is
Tinfo : Type_Info_Acc;
begin
Info := Get_Info (Inter);
- if Info.Interface_Field = O_Fnode_Null then
- case Get_Kind (Inter) is
- when Iir_Kind_Constant_Interface_Declaration
- | Iir_Kind_Variable_Interface_Declaration
- | Iir_Kind_File_Interface_Declaration =>
- Mode := Mode_Value;
- when Iir_Kind_Signal_Interface_Declaration =>
- Mode := Mode_Signal;
- when others =>
- Error_Kind ("translate_interface_type", Inter);
- end case;
- Tinfo := Get_Info (Get_Type (Inter));
- case Tinfo.Type_Mode is
- when Type_Mode_Unknown =>
- raise Internal_Error;
- when Type_Mode_By_Value =>
- return Tinfo.Ortho_Type (Mode);
- when Type_Mode_By_Copy
- | Type_Mode_By_Ref =>
- return Tinfo.Ortho_Ptr_Type (Mode);
- end case;
- else
+ if Info.Interface_Field /= O_Fnode_Null then
return O_Tnode_Null;
end if;
+
+ case Get_Kind (Inter) is
+ when Iir_Kind_Constant_Interface_Declaration
+ | Iir_Kind_Variable_Interface_Declaration
+ | Iir_Kind_File_Interface_Declaration =>
+ Mode := Mode_Value;
+ when Iir_Kind_Signal_Interface_Declaration =>
+ Mode := Mode_Signal;
+ when others =>
+ Error_Kind ("translate_interface_type", Inter);
+ end case;
+ Tinfo := Get_Info (Get_Type (Inter));
+ case Tinfo.Type_Mode is
+ when Type_Mode_Unknown =>
+ raise Internal_Error;
+ when Type_Mode_By_Value =>
+ return Tinfo.Ortho_Type (Mode);
+ when Type_Mode_By_Copy
+ | Type_Mode_By_Ref =>
+ return Tinfo.Ortho_Ptr_Type (Mode);
+ end case;
end Translate_Interface_Type;
procedure Translate_Subprogram_Declaration (Spec : Iir)
@@ -4709,8 +4709,12 @@ package body Translation is
if Get_Kind (Inter) = Iir_Kind_Variable_Interface_Declaration
and then Get_Mode (Inter) in Iir_Out_Modes
and then Tinfo.Type_Mode not in Type_Mode_By_Ref
+ and then Tinfo.Type_Mode /= Type_Mode_File
then
-- This interface is done via the result record.
+ -- Note: file passed through variables are vhdl87 files,
+ -- which are initialized at elaboration and thus
+ -- behave like an IN parameter.
if not Has_Result_Record then
-- Create the record.
Start_Record_Type (El_List);
@@ -19117,7 +19121,10 @@ package body Translation is
raise Internal_Error;
end if;
Params (Pos) := Stabilize (Param);
- if In_Conv /= Null_Iir or else Out_Conv = Null_Iir then
+ if In_Conv /= Null_Iir
+ or else Get_Mode (Formal) = Iir_Inout_Mode
+ -- or else Out_Conv = Null_Iir
+ then
-- Arguments may be assigned if there is an in conversion,
-- or no out conversion.
-- We try to assign even OUT argument, to avoid