I'm still playing with the code, so this is a partial review.
We should prevent inlining of ARM state functions into functions we know
will be T16 if !TARGET_SOFT_FLOAT on the grounds that the architecture
doesn't have floating point instruction encodings in the T16 ISA
(Thumb1). We'll just cause internal compiler errors if we allow this.
On 07/05/15 00:03, Sandra Loosemore wrote:
On 05/06/2015 08:24 AM, Christian Bruel wrote:
diff '--exclude=.svn' -ruN gnu_trunk.p3/gcc/gcc/doc/extend.texi
gnu_trunk.p4/gcc/gcc/doc/extend.texi
--- gnu_trunk.p3/gcc/gcc/doc/extend.texi 2015-05-06 09:00:31.232943164
+0200
+++ gnu_trunk.p4/gcc/gcc/doc/extend.texi 2015-05-06 14:50:05.632612233
+0200
@@ -3419,6 +3419,25 @@
the compiler rejects attempts to specify an alternative.
@end table
+@item target (@var{options})
+@cindex @code{target} function attribute
+As discussed in @ref{Common Function Attributes}, this attribute
+allows specification of target-specific compilation options.
+
+On ARM, the following options are allowed:
+
+@table @samp
+@item thumb
+@cindex @code{target("thumb")} function attribute, ARM
+Force Thumb1 Thumb2 code generation depending on the architecture.
"Force Thumb or Thumb-2 code generation, depending on the architecture."
I'd rather it said something like
"Force code generation in the Thumb (T16/ T32) ISA. The exact
instructions chosen depends on the architecture levels chosen."
+
+@item arm
+@cindex @code{target("arm")} function attribute, ARM
+Force ARM code generation.
"Force code generation in the ARM (A32) ISA."
+@end table
+
+Functions from different modes can be inlined using the caller mode.
Rewrite this based on the review comment about inlining in the Thumb16
state from ARM state.
"...the caller's mode."
+
@node AVR Function Attributes
@subsection AVR Function Attributes
@@ -18436,8 +18455,9 @@
@xref{Function Attributes}, for more information about the
@code{target} attribute and the attribute syntax.
-The @code{#pragma GCC target} pragma is presently implemented for
-x86, PowerPC, and Nios II targets only.
+The @code{#pragma GCC target} pragma is implemented for
+ARM, x86, PowerPC, and Nios II targets.
+
I'd rather say this once we have proper support with arch, cpu and fpu
options enabled. Until such a time I think this hunk is a bit premature.
Ramana