Hello,

I experienced "asm operand requires impossible reload" error in our private 
porting. 
After digging into the reloading pass, I found something a bit fishy. 

The error message is produced in reload_as_needed function (reload1.c)

...
              /* If this was an ASM, make sure that all the reload insns
                 we have generated are valid.  If not, give an error
                 and delete them.  */
              if (asm_noperands (PATTERN (insn)) >= 0)
                for (p = NEXT_INSN (prev); p != next; p = NEXT_INSN (p))
                  if (p != insn && INSN_P (p)
                      && GET_CODE (PATTERN (p)) != USE
                      && (recog_memoized (p) < 0
                          || (extract_insn (p), ! constrain_operands (1))))
                    {
                      error_for_asm (insn,
                                     "%<asm%> operand requires "
                                     "impossible reload");
                      delete_insn (p);
                    }
...

Here the code checks whether all generated reload insns are valid. The "strict"
argument of the constraint_oeprands is set to 1, thus any pseudo register 
operand
will fail the check if I understood correctly. However, at this stage, all the 
generated reload instructions, including normal and asm insns, seems to have 
pseudo register operands. Only later they are replaced by memory operand. If I
disable this piece of code, the code is compiled without problem.

Did I misunderstand something here, or is it an possible bug? The code base is
GCC 4.4 branch. 

Thanks in advance for help.

Cheers,
Bingfeng Mei
Broadcom UK


Reply via email to