This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[patch] for second problem in PR17428 (resent)
- From: Zdenek Dvorak <rakdver at atrey dot karlin dot mff dot cuni dot cz>
- To: gcc-patches at gcc dot gnu dot org
- Cc: roger at eyesopen dot com
- Date: Mon, 14 Feb 2005 12:35:01 +0100
- Subject: [patch] for second problem in PR17428 (resent)
Hello,
the following patch for a problem in PR 17428 (previously posted
in http://gcc.gnu.org/ml/gcc-patches/2004-11/msg00260.html) is
pre-approved by Roger Sayle. Bootstrapped & regtested on i686,
with -fprofile-generate -fspeculative-prefetching -march=athlon.
Zdenek
PR rtl-optimization/17428
* value-prof.c (rtl_find_values_to_profile): Do not look for values to
profile in libcalls.
Index: value-prof.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/value-prof.c,v
retrieving revision 1.15
diff -c -3 -p -r1.15 value-prof.c
*** value-prof.c 10 Sep 2004 10:44:48 -0000 1.15
--- value-prof.c 4 Nov 2004 00:18:09 -0000
*************** static void
*** 288,300 ****
rtl_find_values_to_profile (histogram_values *values)
{
rtx insn;
! unsigned i;
life_analysis (NULL, PROP_DEATH_NOTES);
*values = VEC_alloc (histogram_value, 0);
for (insn = get_insns (); insn; insn = NEXT_INSN (insn))
! insn_values_to_profile (insn, values);
for (i = 0; i < VEC_length (histogram_value, *values); i++)
{
--- 288,317 ----
rtl_find_values_to_profile (histogram_values *values)
{
rtx insn;
! unsigned i, libcall_level;
life_analysis (NULL, PROP_DEATH_NOTES);
*values = VEC_alloc (histogram_value, 0);
+ libcall_level = 0;
for (insn = get_insns (); insn; insn = NEXT_INSN (insn))
! {
! if (find_reg_note (insn, REG_LIBCALL, NULL_RTX))
! libcall_level++;
!
! /* Do not instrument values inside libcalls (we are going to split block
! due to instrumentation, and libcall blocks should be local to a single
! basic block). */
! if (!libcall_level)
! insn_values_to_profile (insn, values);
!
! if (find_reg_note (insn, REG_RETVAL, NULL_RTX))
! {
! gcc_assert (libcall_level > 0);
! libcall_level--;
! }
! }
! gcc_assert (libcall_level == 0);
for (i = 0; i < VEC_length (histogram_value, *values); i++)
{