aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArnaud Charlet <charlet@gcc.gnu.org>2012-03-07 15:15:16 +0100
committerArnaud Charlet <charlet@gcc.gnu.org>2012-03-07 15:15:16 +0100
commit3777b2c07a446104c84f39542c83d8e85490ead4 (patch)
treeb5b016e7358d1436e71da0b588afa4e22f20f563
parent1274e3a474562bed5e6d1861b8520d9985150716 (diff)
downloadgcc-3777b2c07a446104c84f39542c83d8e85490ead4.zip
gcc-3777b2c07a446104c84f39542c83d8e85490ead4.tar.gz
gcc-3777b2c07a446104c84f39542c83d8e85490ead4.tar.bz2
[multiple changes]
2012-03-07 Eric Botcazou <ebotcazou@adacore.com> * gnat_ugn.texi (Inline Assembler): Fix swapping of Input and Output operands throughout. 2012-03-07 Hristian Kirtchev <kirtchev@adacore.com> * sem_ch12.adb (Earlier): When two nodes come from the same generic instantiation, compare their locations. Otherwise always use the top level locations of the nodes. 2012-03-07 Thomas Quinot <quinot@adacore.com> * einfo.ads, sem_prag.adb: Minor reformatting. From-SVN: r185044
-rw-r--r--gcc/ada/ChangeLog15
-rw-r--r--gcc/ada/einfo.ads2
-rw-r--r--gcc/ada/gnat_ugn.texi22
-rw-r--r--gcc/ada/sem_ch12.adb20
-rw-r--r--gcc/ada/sem_prag.adb4
5 files changed, 43 insertions, 20 deletions
diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog
index 2bbdb35..228c442 100644
--- a/gcc/ada/ChangeLog
+++ b/gcc/ada/ChangeLog
@@ -1,3 +1,18 @@
+2012-03-07 Eric Botcazou <ebotcazou@adacore.com>
+
+ * gnat_ugn.texi (Inline Assembler): Fix swapping of Input and
+ Output operands throughout.
+
+2012-03-07 Hristian Kirtchev <kirtchev@adacore.com>
+
+ * sem_ch12.adb (Earlier): When two nodes come from the same
+ generic instantiation, compare their locations. Otherwise always
+ use the top level locations of the nodes.
+
+2012-03-07 Thomas Quinot <quinot@adacore.com>
+
+ * einfo.ads, sem_prag.adb: Minor reformatting.
+
2012-03-05 Jason Merrill <jason@redhat.com>
* gcc-interface/Make-lang.in (doc/gnat_ugn.texi): Build xgnatugn
diff --git a/gcc/ada/einfo.ads b/gcc/ada/einfo.ads
index e0d7654..648bf83 100644
--- a/gcc/ada/einfo.ads
+++ b/gcc/ada/einfo.ads
@@ -2819,7 +2819,7 @@ package Einfo is
-- interface types. At run-time thunks displace the pointer to the object
-- (pointer named "this" in the C++ terminology) from a secondary
-- dispatch table to the primary dispatch table associated with a given
--- tagged type. Set by Expand_Interface Thunk and used by Expand_Call to
+-- tagged type. Set by Expand_Interface_Thunk and used by Expand_Call to
-- handle extra actuals associated with accessibility level.
-- Is_Trivial_Subprogram (Flag235)
diff --git a/gcc/ada/gnat_ugn.texi b/gcc/ada/gnat_ugn.texi
index 4d0c01c..e93320c 100644
--- a/gcc/ada/gnat_ugn.texi
+++ b/gcc/ada/gnat_ugn.texi
@@ -26107,8 +26107,8 @@ procedure Increment is
Result : Unsigned_32;
begin
Asm ("incl %0",
- Inputs => Unsigned_32'Asm_Input ("a", Value),
- Outputs => Unsigned_32'Asm_Output ("=a", Result));
+ Outputs => Unsigned_32'Asm_Output ("=a", Result),
+ Inputs => Unsigned_32'Asm_Input ("a", Value));
return Result;
end Incr;
@@ -26134,10 +26134,8 @@ The @code{"="} constraint, indicating an output value, is not present.
You can have multiple input variables, in the same way that you can have more
than one output variable.
-The parameter count (%0, %1) etc, now starts at the first input
-statement, and continues with the output statements.
-When both parameters use the same variable, the
-compiler will treat them as the same %n operand, which is the case here.
+The parameter count (%0, %1) etc, still starts at the first output statement,
+and continues with the input statements.
Just as the @code{Outputs} parameter causes the register to be stored into the
target variable after execution of the assembler statements, so does the
@@ -26191,8 +26189,8 @@ procedure Increment_2 is
Result : Unsigned_32;
begin
Asm ("incl %0",
- Inputs => Unsigned_32'Asm_Input ("a", Value),
- Outputs => Unsigned_32'Asm_Output ("=a", Result));
+ Outputs => Unsigned_32'Asm_Output ("=a", Result),
+ Inputs => Unsigned_32'Asm_Input ("a", Value));
return Result;
end Incr;
pragma Inline (Increment);
@@ -26274,8 +26272,8 @@ assembly code; for example:
@group
Asm ("movl %0, %%ebx" & LF & HT &
"movl %%ebx, %1",
- Inputs => Unsigned_32'Asm_Input ("g", Var_In),
- Outputs => Unsigned_32'Asm_Output ("=g", Var_Out));
+ Outputs => Unsigned_32'Asm_Output ("=g", Var_Out),
+ Inputs => Unsigned_32'Asm_Input ("g", Var_In));
@end group
@end smallexample
@noindent
@@ -26289,8 +26287,8 @@ to identify the registers that will be used by your assembly code:
@group
Asm ("movl %0, %%ebx" & LF & HT &
"movl %%ebx, %1",
- Inputs => Unsigned_32'Asm_Input ("g", Var_In),
Outputs => Unsigned_32'Asm_Output ("=g", Var_Out),
+ Inputs => Unsigned_32'Asm_Input ("g", Var_In),
Clobber => "ebx");
@end group
@end smallexample
@@ -26324,8 +26322,8 @@ the @code{Volatile} parameter to @code{True}; for example:
@group
Asm ("movl %0, %%ebx" & LF & HT &
"movl %%ebx, %1",
- Inputs => Unsigned_32'Asm_Input ("g", Var_In),
Outputs => Unsigned_32'Asm_Output ("=g", Var_Out),
+ Inputs => Unsigned_32'Asm_Input ("g", Var_In),
Clobber => "ebx",
Volatile => True);
@end group
diff --git a/gcc/ada/sem_ch12.adb b/gcc/ada/sem_ch12.adb
index c463e57..d637827 100644
--- a/gcc/ada/sem_ch12.adb
+++ b/gcc/ada/sem_ch12.adb
@@ -7159,12 +7159,22 @@ package body Sem_Ch12 is
end if;
-- At this point either both nodes came from source or we approximated
- -- their source locations through neighbouring source statements. There
- -- is no need to look at the top level locations of P1 and P2 because
- -- both nodes are in the same list and whether the enclosing context is
- -- instantiated is irrelevant.
+ -- their source locations through neighbouring source statements.
- return Sloc (P1) < Sloc (P2);
+ -- When two nodes come from the same instance, they have identical top
+ -- level locations. To determine proper relation within the tree, check
+ -- their locations within the template.
+
+ if Top_Level_Location (Sloc (P1)) = Top_Level_Location (Sloc (P2)) then
+ return Sloc (P1) < Sloc (P2);
+
+ -- The two nodes either come from unrelated instances or do not come
+ -- from instantiated code at all.
+
+ else
+ return Top_Level_Location (Sloc (P1))
+ < Top_Level_Location (Sloc (P2));
+ end if;
end Earlier;
----------------------
diff --git a/gcc/ada/sem_prag.adb b/gcc/ada/sem_prag.adb
index 72d47ab..39d406e 100644
--- a/gcc/ada/sem_prag.adb
+++ b/gcc/ada/sem_prag.adb
@@ -11965,8 +11965,8 @@ package body Sem_Prag is
if not Is_Entity_Name (Get_Pragma_Arg (Arg1))
or else not
- Ekind_In (Entity (Get_Pragma_Arg (Arg1)), E_Variable,
- E_Constant)
+ Ekind_In (Entity (Get_Pragma_Arg (Arg1)), E_Variable,
+ E_Constant)
then
Error_Pragma_Arg ("pragma% only applies to objects", Arg1);
end if;