git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@3415
4a8a32a2-be11-0410-ad9d-
d568d2c75423
+2004-08-02 Maarten Brock <sourceforge.brock AT dse.nl>
+
+ * src/SDCClrange.c (rlivePoint): fixed bug 988568, thanks to anonymous
+
2004-08-02 Slade Rich <slade_rich AT users.sourceforge.net>
* src/pic/gen.c tidied up tabs
2004-08-02 Slade Rich <slade_rich AT users.sourceforge.net>
* src/pic/gen.c tidied up tabs
under the terms of the GNU General Public License as published by the
Free Software Foundation; either version 2, or (at your option) any
later version.
under the terms of the GNU General Public License as published by the
Free Software Foundation; either version 2, or (at your option) any
later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
In other words, you are welcome to use, share and improve this program.
You are forbidden to forbid anyone else to use, share and improve
In other words, you are welcome to use, share and improve this program.
You are forbidden to forbid anyone else to use, share and improve
- what you give them. Help stamp out software-hoarding!
+ what you give them. Help stamp out software-hoarding!
-------------------------------------------------------------------------*/
#include "common.h"
-------------------------------------------------------------------------*/
#include "common.h"
/*-----------------------------------------------------------------*/
/* hashiCodeKeys - add all iCodes to the hash table */
/*-----------------------------------------------------------------*/
/*-----------------------------------------------------------------*/
/* hashiCodeKeys - add all iCodes to the hash table */
/*-----------------------------------------------------------------*/
hashiCodeKeys (eBBlock ** ebbs, int count)
{
int i;
hashiCodeKeys (eBBlock ** ebbs, int count)
{
int i;
{
iCode *ic;
for (ic = ebbs[i]->sch; ic; ic = ic->next)
{
iCode *ic;
for (ic = ebbs[i]->sch; ic; ic = ic->next)
- hTabAddItem (&iCodehTab, ic->key, ic);
+ hTabAddItem (&iCodehTab, ic->key, ic);
}
}
/*-----------------------------------------------------------------*/
/* sequenceiCode - creates a sequence number for the iCode & add */
/*-----------------------------------------------------------------*/
}
}
/*-----------------------------------------------------------------*/
/* sequenceiCode - creates a sequence number for the iCode & add */
/*-----------------------------------------------------------------*/
sequenceiCode (eBBlock ** ebbs, int count)
{
int i;
sequenceiCode (eBBlock ** ebbs, int count)
{
int i;
/*-----------------------------------------------------------------*/
/* setToRange - set the range to for an operand */
/*-----------------------------------------------------------------*/
/*-----------------------------------------------------------------*/
/* setToRange - set the range to for an operand */
/*-----------------------------------------------------------------*/
setToRange (operand * op, int to, bool check)
{
/* only for compiler defined temps */
setToRange (operand * op, int to, bool check)
{
/* only for compiler defined temps */
{
int i, key;
symbol *sym;
{
int i, key;
symbol *sym;
for (i = 0; i < count; i++)
{
iCode *ic;
for (i = 0; i < count; i++)
{
iCode *ic;
for (ic = ebbs[i]->sch; ic; ic = ic->next)
{
if (ic->op == CALL || ic->op == PCALL)
for (ic = ebbs[i]->sch; ic; ic = ic->next)
{
if (ic->op == CALL || ic->op == PCALL)
- if (bitVectIsZero (OP_SYMBOL (IC_RESULT (ic))->uses))
- bitVectUnSetBit (ebbs[i]->defSet, ic->key);
+ if (bitVectIsZero (OP_SYMBOL (IC_RESULT (ic))->uses))
+ bitVectUnSetBit (ebbs[i]->defSet, ic->key);
/* for all iTemps alive at this iCode */
for (key = 1; key < ic->rlive->size; key++)
/* for all iTemps alive at this iCode */
for (key = 1; key < ic->rlive->size; key++)
if (IS_ITEMP (IC_LEFT (uic)))
if (IC_LEFT (uic)->key == sym->key)
if (IS_ITEMP (IC_LEFT (uic)))
if (IC_LEFT (uic)->key == sym->key)
if (ebbs[i]->ech)
alive = bitVectCplAnd ( bitVectCopy (ebbs[i]->ech->rlive), alive);
if (ebbs[i]->ech)
alive = bitVectCplAnd ( bitVectCopy (ebbs[i]->ech->rlive), alive);
for (key = 1; key < alive->size; key++)
{
if (!bitVectBitValue (alive, key))
for (key = 1; key < alive->size; key++)
{
if (!bitVectBitValue (alive, key))
continue;
sym2 = hTabItemWithKey(liveRanges, key2);
continue;
sym2 = hTabItemWithKey(liveRanges, key2);
if (!sym2->isitmp)
continue;
if (!sym2->isitmp)
continue;
if (bitVectBitValue (defs, i) &&
(ic = hTabItemWithKey (iCodehTab, i)) &&
(ic->seq >= fseq && ic->seq <= toseq))
if (bitVectBitValue (defs, i) &&
(ic = hTabItemWithKey (iCodehTab, i)) &&
(ic->seq >= fseq && ic->seq <= toseq))
adjustIChain (eBBlock ** ebbs, int count)
{
int i;
adjustIChain (eBBlock ** ebbs, int count)
{
int i;
for (i = 0; i < count; i++)
{
iCode *ic;
for (i = 0; i < count; i++)
{
iCode *ic;
if (ebbs[i]->noPath)
continue;
if (ebbs[i]->noPath)
continue;
while (ic->prev)
ic = ic->prev;
ebbs[i]->sch = ic;
while (ic->prev)
ic = ic->prev;
ebbs[i]->sch = ic;
ic = ebbs[i]->ech;
while (ic->next)
ic = ic->next;
ic = ebbs[i]->ech;
while (ic->next)
ic = ic->next;