This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug inline-asm/11925] segment violation due to incorrect operand constraints
- From: "jbeulich at novell dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 18 Aug 2003 06:37:24 -0000
- Subject: [Bug inline-asm/11925] segment violation due to incorrect operand constraints
- References: <20030815064207.11925.jbeulich@novell.com>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=11925
------- Additional Comments From jbeulich at novell dot com 2003-08-18 06:37 -------
Compiled with -O2, the following code results in an instruction "xchgb %sil,%ax"
to be emitted with 3.3.1. The SEGV has been masked by a re-arrangement of
hi_reg_name to follow qi_high_reg_name between 3.2.2 and 3.3.1. Still, a proper
error message would be the real solution of the problem (under the assumption
that the re-arrangement was done to mask this problem).
static inline unsigned wswap(unsigned x) {
__asm__("xchgb %b0,%h0" : "+r" (x));
return x;
}
unsigned test(unsigned n) {
unsigned i, s = 0;
for(i = 0; i < n; ++i)
s += wswap(s) + wswap(i);
return s + wswap(n);
}