This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: PATCH: Fix search-and-replaceo in optimize_mode_switching? (fwd)
- From: tm <tm at mail dot kloo dot net>
- To: rth at redhat dot com
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Thu, 23 May 2002 14:41:46 -0700 (PDT)
- Subject: Re: PATCH: Fix search-and-replaceo in optimize_mode_switching? (fwd)
I believe this change:
Revision 1.42 / (download) - annotate - [select for diffs] , Fri May 17
02:31:36 2002 UTC (6 days, 12 hours ago) by rth
Branch: MAIN
CVS Tags: ra-merge-20020521, pch-merge-20020517, cfg-merge-20022205,
ast-optimizer-merge-20020519
Changes since 1.41: +186 -184 lines
Diff to previous 1.41 (colored)
Revert "Basic block renumbering removal", and two followup
patches.
caused the problem - can you verify and approve the fix?
Toshi
---------- Forwarded message ----------
Date: Thu, 23 May 2002 14:38:39 -0700
From: Toshiyasu Morita <toshiyasu.morita@hsa.hitachi.com>
To: gcc-patches@gcc.gnu.org
Cc: tm@kloo.net
Subject: PATCH: Fix search-and-replaceo in optimize_mode_switching?
When GCC CVS head is configured for --target=sh-elf and built, this error
occurs:
gcc -c -DIN_GCC -DCROSS_COMPILE -g -O2 -W -Wall -Wwrite-strings -Wstrict-p
rototypes -Wmissing-prototypes -Wtraditional -pedantic -Wno-long-long -DHAV
E_CONFIG_H -I. -I. -I../../gcc/gcc -I../../gcc/gcc/. -I../../gcc/gcc/conf
ig -I../../gcc/gcc/../include ../../gcc/gcc/lcm.c -o lcm.o
../../gcc/gcc/lcm.c: In function `optimize_mode_switching':
../../gcc/gcc/lcm.c:1063: warning: comparison between signed and unsigned
../../gcc/gcc/lcm.c:1152: array subscript is not an integer
../../gcc/gcc/lcm.c:1153: array subscript is not an integer
../../gcc/gcc/lcm.c:1158: array subscript is not an integer
../../gcc/gcc/lcm.c:1160: array subscript is not an integer
../../gcc/gcc/lcm.c:1161: array subscript is not an integer
../../gcc/gcc/lcm.c:1166: array subscript is not an integer
make[1]: *** [lcm.o] Error 1
Looks like someone made a search-and-replaceo? Patch enclosed.
Also, sh-elf has been broken for about two weeks now. It still
triggers an RTL flag check:
cc1: RTL flag check: CONSTANT_POOL_ADDDRESS_P used with unexpected rtx code
`const_int' in nonmemory_operand, at recog.c:1222
2002-05-23 Toshiyasu Morita <toshiyasu.morita@hsa.hitachi.com>
* lcm.c (optimize_mode_switching): Change bb used as indices
to bb->index.
*** lcm.c.bak Thu May 23 13:55:02 2002
--- lcm.c Thu May 23 13:55:36 2002
*************** optimize_mode_switching (file)
*** 1149,1169 ****
/* If the block already has MODE, pretend it
has none (because we don't need to set it),
but retain whatever mode it computes. */
! if (info[bb].seginfo->mode == mode)
! info[bb].seginfo->mode = no_mode;
/* Insert a fake computing definition of MODE into entry
blocks which compute no mode. This represents the mode on
entry. */
! else if (info[bb].computing == no_mode)
{
! info[bb].computing = mode;
! info[bb].seginfo->mode = no_mode;
}
}
bb = EXIT_BLOCK_PTR;
! info[bb].seginfo->mode = mode;
}
}
#endif /* NORMAL_MODE */
--- 1149,1169 ----
/* If the block already has MODE, pretend it
has none (because we don't need to set it),
but retain whatever mode it computes. */
! if (info[bb->index].seginfo->mode == mode)
! info[bb->index].seginfo->mode = no_mode;
/* Insert a fake computing definition of MODE into entry
blocks which compute no mode. This represents the mode on
entry. */
! else if (info[bb->index].computing == no_mode)
{
! info[bb->index].computing = mode;
! info[bb->index].seginfo->mode = no_mode;
}
}
bb = EXIT_BLOCK_PTR;
! info[bb->index].seginfo->mode = mode;
}
}
#endif /* NORMAL_MODE */