This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [patch] Auto-set ARM -mimplicit-it option


On 16/07/10 13:46, Richard Earnshaw wrote:
Are you sure? The gas docs say:

         The -mimplicit-it option controls the behavior of the assembler
         when conditional instructions are not enclosed in IT blocks.
         There are four possible behaviors. If never is specified, such
         constructs cause a warning in ARM code and an error in Thumb-2
         code. If always is specified, such constructs are accepted in
         both ARM and Thumb-2 code, where the IT instruction is added
         implicitly. If arm is specified, such constructs are accepted in
         ARM code and cause an error in Thumb-2 code. If thumb is
         specified, such constructs cause a warning in ARM code and are
         accepted in Thumb-2 code. If you omit this option, the behavior
         is equivalent to -mimplicit-it=arm.

Right, "never" and "always" mods are irrelevant here - I'm not proposing that the compiler ever pass either automatically.


So, the choice is between -mimplicit-it=arm (the gas default) or -mimplicit-it=thumb. I'm proposing the latter, but only in the case that the compiler is running in thumb mode.

Based on this, I think:

         If arm is specified, such constructs [ie. implicit insertion of
         IT instructions] are accepted in ARM code and cause an error in
         Thumb-2 code.

Is the behaviour that we *do* want.  Ie, accept implicit IT blocks in
ARM code, but cause an error if they're implicit in Thumb code.  The
compiler should never generate conditional Thumb-2 instructions without
emitting an IT instruction first.

The problem is not generated code. I believe the problem is inline assembler.


I must admit that the docs are not particularly clearly written, but
based on what I think they say, I think the default is the correct
choice for the compiler.

The default is the right choice in ARM mode, but the complaint is that in thumb mode you suddenly need to be explicit.


I'm not sure exactly where this issue comes from, but ARM Ubuntu (which is almost exclusively thumb, I think) has had a patch like this for some time, and found it solves some problems.

Whatever, it seems to me quite reasonable that if the assembler has smarts in one mode, then probably it should do in the other, but then, I don't claim to be an ARM expert.

Andrew


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]