optimization/10396: Constraint alternatives cause error " `asm' operand requires impossible reload"
gonz@ratloop.com
gonz@ratloop.com
Mon Apr 14 04:06:00 GMT 2003
>Number: 10396
>Category: optimization
>Synopsis: Constraint alternatives cause error " `asm' operand requires impossible reload"
>Confidential: no
>Severity: non-critical
>Priority: medium
>Responsible: unassigned
>State: open
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Mon Apr 14 04:06:01 UTC 2003
>Closed-Date:
>Last-Modified:
>Originator: Pete Gonzalez
>Release: GCC 3.2.1 (cross compiler)
>Organization:
>Environment:
This is a custom build of GCC on Win32 Cygwin, with target CPU arm7tdmi. I am using the C++ front end.
>Description:
When compiling with optimizations (-O2 or -O3), the function below sometimes causes GCC to fail with the error message "`asm' operand requires impossible reload". The function compiles fine by itself and also in simple contexts; it seems that the error only occurs in complex inlining situations.
The error goes away if I reduce the constraints to a single alternative (instead of 3). It does not matter which of the three I choose, which suggests that my constraint expressions are valid.
The "impossible reload" message is coming from line 3933 of gcc/reload1.c, but I can't find any documentation on this error.
_____________________________
inline int multiplyFixedPoint(int mantissaA,int mantissaB) {
int result;
int temp;
asm("\n\
smull %0, %1, %2, %3 \n\
mov %0, %0, lsr #16 \n\
orr %0, %0, %1, lsl #16 \n\
" : "=&r,&r,&r"(result), "=&r,&r,&r"(temp) // outputs
: "%r,r,r"(mantissaA), "0,1,r"(mantissaB) // inputs
: "cc" // clobbered
);
return result;
}
>How-To-Repeat:
If someone is interested in pursuing this, I can isolate some source code that reproduces the problem. However, the situations which expose the bug might depend on the particular build of GCC.
>Fix:
>Release-Note:
>Audit-Trail:
>Unformatted:
More information about the Gcc-prs
mailing list