From: SourceForge.net <no...@so...> - 2004-11-24 06:27:30
|
Bugs item #1070644, was opened at 2004-11-21 15:38 Message generated for change (Comment added) made by epetrich You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=100599&aid=1070644&group_id=599 Category: None Group: None Status: Open Resolution: None Priority: 6 Submitted By: Frieder Ferlemann (frief) Assigned to: Nobody/Anonymous (nobody) Summary: --nogcse Register Allocation Problem Initial Comment: When the attached file is compiled with sdcc -c --nogcse des.c (SDCC #883) then variables i,j are assigned to the same registers: ;------------------------------------------------------------ ;Allocation info for local variables in function '__hal_des_ker' ;------------------------------------------------------------ ;i Allocated to registers r2 ;j Allocated to registers r2 ;sloc0 Allocated with name '___hal_des_ker_sloc0_1_0' ;sloc1 Allocated with name '___hal_des_ker_sloc1_1_0' ;sloc2 Allocated with name '___hal_des_ker_sloc2_1_0' Compiling without --nogcse is ok. ---------------------------------------------------------------------- >Comment By: Erik Petrich (epetrich) Date: 2004-11-24 00:27 Message: Logged In: YES user_id=635249 After reviewing the code, it doesn't look like there is a register allocation problem. Yes, r2 has been assigned to both i and j. However, within the loops, i and j have each been replaced by an induction variable. The induction variables are assigned separate registers. Since i is unused after being copied into its induction variable, r2 becomes available for reuse. It is then reassigned to j, just long enough to load an initial value into j's induction variable. Could someone else please double check that I haven't overlooked anything (the assembly listing is rather long and scary) and close this bug if you concur. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=100599&aid=1070644&group_id=599 |