This is the mail archive of the gcc@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: Porting GCC to new target, branch implementation


Savithri Venkatachalapathy wrote:
L2: operands[0] = branch_op[0];
    strcat(buffer,\" %0\");
L3: operands[0] = xoperands[0];
    strcat(buffer,\" %0\");
    output_asm_insn (buffer, operands);

There is an obvious programming error here. You are storing two different values into operands[0], so output_asm_insn can only see one of them them. You need to use a different operand number for every different operand. It is Ok for the output template to use more operands than there are in the pattern, as long as you don't use more than the maximum array size, but that is pretty unlikely.


Also, building strings in a fixed size buffer is a bad idea in general. You should try to avoid doing this.
--
Jim Wilson, GNU Tools Support, http://www.SpecifixInc.com



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