Commit 6fd52b78 by Arnaud Charlet

[multiple changes]

2014-10-31  Eric Botcazou  <ebotcazou@adacore.com>

	* inline.adb (Has_Excluded_Declaration): With back-end inlining,
	only return true for nested packages.
	(Cannot_Inline): Issue errors/warnings whatever the optimization level
	for back-end inlining and remove assertion.

2014-10-31  Sergey Rybin  <rybin@adacore.com frybin>

	* table.adb (Tree_Read, Tree_Write): Use parentheses to specify
	the desired order of '*' and '/' operations to avoid overflow.

2014-10-31  Eric Botcazou  <ebotcazou@adacore.com>

	* exp_ch6.adb (Do_Inline): Remove unreachable code.
	(Do_Inline_Always): Likewise.

2014-10-31  Vincent Celier  <celier@adacore.com>

	* prj-nmsc.adb (Check_Stand_Alone_Library): Change error message
	when library has no Ada interfaces and Library_Standalone is
	declared.

From-SVN: r216961
parent d99565f8
2014-10-31 Eric Botcazou <ebotcazou@adacore.com>
* inline.adb (Has_Excluded_Declaration): With back-end inlining,
only return true for nested packages.
(Cannot_Inline): Issue errors/warnings whatever the optimization level
for back-end inlining and remove assertion.
2014-10-31 Sergey Rybin <rybin@adacore.com frybin>
* table.adb (Tree_Read, Tree_Write): Use parentheses to specify
the desired order of '*' and '/' operations to avoid overflow.
2014-10-31 Eric Botcazou <ebotcazou@adacore.com>
* exp_ch6.adb (Do_Inline): Remove unreachable code.
(Do_Inline_Always): Likewise.
2014-10-31 Vincent Celier <celier@adacore.com>
* prj-nmsc.adb (Check_Stand_Alone_Library): Change error message
when library has no Ada interfaces and Library_Standalone is
declared.
2014-10-31 Arnaud Charlet <charlet@adacore.com>
* sem_ch13.adb (Check_Constant_Address_Clause): Disable checks
......
......@@ -1225,9 +1225,7 @@ package body Inline is
Error_Msg_NE (Msg & "p?", N, Subp);
end if;
return;
-- New semantics
-- New semantics relying on back end inlining
elsif Is_Serious then
......@@ -1242,9 +1240,7 @@ package body Inline is
Set_Is_Inlined_Always (Subp, False);
Error_Msg_NE (Msg & "p?", N, Subp);
-- Do not issue errors/warnings when compiling with optimizations
elsif Optimization_Level = 0 then
else
-- Do not emit warning if this is a predefined unit which is not
-- the main unit. This behavior is currently provided for backward
......@@ -1281,24 +1277,13 @@ package body Inline is
Error_Msg_NE (Msg (Msg'First .. Msg'Last - 1), N, Subp);
else pragma Assert (Front_End_Inlining);
else
Set_Is_Inlined (Subp, False);
-- When inlining cannot take place we must issue an error.
-- For backward compatibility we still report a warning.
if Ineffective_Inline_Warnings then
Error_Msg_NE (Msg & "p?", N, Subp);
end if;
end if;
-- Compiling with optimizations enabled it is too early to report
-- problems since the backend may still perform inlining. In order
-- to report unhandled inlinings the program must be compiled with
-- -Winline and the error is reported by the backend.
else
null;
end if;
end Cannot_Inline;
......@@ -3327,11 +3312,25 @@ package body Inline is
D := First (Decls);
while Present (D) loop
if Nkind (D) = N_Subprogram_Body then
-- First declarations universally excluded
if Nkind (D) = N_Package_Declaration then
Cannot_Inline
("cannot inline & (nested subprogram)?",
("cannot inline & (nested package declaration)?",
D, Subp);
return True;
elsif Nkind (D) = N_Package_Instantiation then
Cannot_Inline
("cannot inline & (nested package instantiation)?",
D, Subp);
return True;
end if;
-- Then declarations excluded only for front end inlining
if Back_End_Inlining then
null;
elsif Nkind (D) = N_Task_Type_Declaration
or else Nkind (D) = N_Single_Task_Declaration
......@@ -3349,9 +3348,9 @@ package body Inline is
D, Subp);
return True;
elsif Nkind (D) = N_Package_Declaration then
elsif Nkind (D) = N_Subprogram_Body then
Cannot_Inline
("cannot inline & (nested package declaration)?",
("cannot inline & (nested subprogram)?",
D, Subp);
return True;
......@@ -3368,12 +3367,6 @@ package body Inline is
("cannot inline & (nested procedure instantiation)?",
D, Subp);
return True;
elsif Nkind (D) = N_Package_Instantiation then
Cannot_Inline
("cannot inline & (nested package instantiation)?",
D, Subp);
return True;
end if;
Next (D);
......
......@@ -4711,7 +4711,7 @@ package body Prj.Nmsc is
then
Error_Msg
(Data.Flags,
"Library_Standalone valid only if Library_Interface is set",
"Library_Standalone valid only if library has Ada interfaces",
Lib_Standalone.Location, Project);
end if;
......
......@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
-- Copyright (C) 1992-2012, Free Software Foundation, Inc. --
-- Copyright (C) 1992-2014, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
......@@ -399,7 +399,7 @@ package body Table is
Tree_Read_Data
(Tree_Get_Table_Address,
(Last_Val - Int (First) + 1) *
Table_Type'Component_Size / Storage_Unit);
(Table_Type'Component_Size / Storage_Unit));
end Tree_Read;
----------------
......@@ -415,7 +415,7 @@ package body Table is
Tree_Write_Data
(Tree_Get_Table_Address,
(Last_Val - Int (First) + 1) *
Table_Type'Component_Size / Storage_Unit);
(Table_Type'Component_Size / Storage_Unit));
end Tree_Write;
begin
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment