+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
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;
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
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);
@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
@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
@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
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;
----------------------