Missing asm constraint exposing compiler version differences

Philip Prindeville philipp_subx@redfish-solutions.com
Sun Aug 29 10:06:00 GMT 2010


I work a bit with Asterisk, the IP-PBX open software.  There's a GSM library that's included in the source tree.

The problem we're encountering is that when compiled with gcc 4.1.x and 4.3 or later, it works fine.

But some of our target platforms only support gcc 4.2, and when we compile against this, the optimizer in GCC exposes the fact that someone writing some ASM stubs forgot to correctly annotate a constraint, and that lack of a constraint is causing the optimizer to change the generated object more than it should.

There are a lot of lines of source code, and most of my experience with asm() stubs has been rudimentary, so I'm asking for an outside pair of eyeballs that might be better skilled at identifying how the asm should be annotated than me.

The suspect code is here:


Previous tweaks to the annotation were:


but I suspect there's something still missing.

Any help would be appreciated as this issue has been dogging us for a couple of years now.



More information about the Gcc-help mailing list