GCC Status Report (2004-03-21)
Jan Hubicka
hubicka@ucw.cz
Mon Mar 22 15:27:00 GMT 2004
>
> GCC 3.4
> =======
> * Jan Hubicka
>
> PR 13974 relates to cases where GCC 3.4 emits bad debugging
> information. This is an important PR because it's going to affect
> people's ability to use GCC 3.4 for development. From looking at
> the PR, it looks like you and Dan Jacobowitz have reached some kind
> of consensus, and on 2004-03-14 you indicated you'd have patch
> "Monday or Tuesday". Is that patch available? Has Dan looked it
> over and confirmed it fixes the problem?
Sorry for being late, somehow the patch got suck in testing scripts and
I managed to not attach it to the history.
The patch makes debug information with optimization less accurate, at
least in my "gcov" metric right now (I do gcov with and without
optimization and diff the output). I am not sure how to test the
patch more throroughly as the problem mentioned in PR is not caught by
my testing (the line number is one instruction off that makes no
difference for gcov. The concept is little bit more safe and of course
i can go other way around and simply modify all the
emit_insn_before/after calls that do not relate to the specified
instruction to use different name.
I am not sure how far we want to go for 3.4. The patch attached just
modify the existing functions without attempting to do the
classification.
2004-03-22 Jan Hubicka <jh@suse.cz>
* emit_rtl.c (emit_*_insn_before, emit_*_insn_after): Set locators
according to the specified instruction.
Index: emit-rtl.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/emit-rtl.c,v
retrieving revision 1.383
diff -c -3 -p -r1.383 emit-rtl.c
*** emit-rtl.c 6 Mar 2004 01:21:26 -0000 1.383
--- emit-rtl.c 17 Mar 2004 12:14:25 -0000
*************** emit_insn_before (rtx x, rtx before)
*** 3919,3924 ****
--- 3919,3925 ----
{
rtx last = before;
rtx insn;
+ rtx first = PREV_INSN (before);
#ifdef ENABLE_RTL_CHECKING
if (before == NULL_RTX)
*************** emit_insn_before (rtx x, rtx before)
*** 3957,3962 ****
--- 3958,3976 ----
add_insn_before (last, before);
break;
}
+ if (active_insn_p (before) && INSN_LOCATOR (before))
+ {
+ int loc = INSN_LOCATOR (before);
+ first = NEXT_INSN (first);
+ while (1)
+ {
+ if (active_insn_p (first) && ! INSN_LOCATOR (first))
+ INSN_LOCATOR (first) = loc;
+ if (first == last)
+ break;
+ first = NEXT_INSN (first);
+ }
+ }
return last;
}
*************** rtx
*** 3968,3973 ****
--- 3982,3988 ----
emit_jump_insn_before (rtx x, rtx before)
{
rtx insn, last = NULL_RTX;
+ rtx first = PREV_INSN (before);
#ifdef ENABLE_RTL_CHECKING
if (before == NULL_RTX)
*************** emit_jump_insn_before (rtx x, rtx before
*** 4003,4008 ****
--- 4018,4036 ----
add_insn_before (last, before);
break;
}
+ if (active_insn_p (before) && INSN_LOCATOR (before))
+ {
+ int loc = INSN_LOCATOR (before);
+ first = NEXT_INSN (first);
+ while (1)
+ {
+ if (active_insn_p (first) && ! INSN_LOCATOR (first))
+ INSN_LOCATOR (first) = loc;
+ if (first == last)
+ break;
+ first = NEXT_INSN (first);
+ }
+ }
return last;
}
*************** rtx
*** 4014,4019 ****
--- 4042,4048 ----
emit_call_insn_before (rtx x, rtx before)
{
rtx last = NULL_RTX, insn;
+ rtx first = PREV_INSN (before);
#ifdef ENABLE_RTL_CHECKING
if (before == NULL_RTX)
*************** emit_call_insn_before (rtx x, rtx before
*** 4049,4054 ****
--- 4078,4096 ----
add_insn_before (last, before);
break;
}
+ if (active_insn_p (before) && INSN_LOCATOR (before))
+ {
+ int loc = INSN_LOCATOR (before);
+ first = NEXT_INSN (first);
+ while (1)
+ {
+ if (active_insn_p (first) && ! INSN_LOCATOR (first))
+ INSN_LOCATOR (first) = loc;
+ if (first == last)
+ break;
+ first = NEXT_INSN (first);
+ }
+ }
return last;
}
*************** emit_insn_after (rtx x, rtx after)
*** 4176,4181 ****
--- 4218,4235 ----
add_insn_after (last, after);
break;
}
+ if (active_insn_p (after) && INSN_LOCATOR (after))
+ {
+ int loc = INSN_LOCATOR (after);
+ while (1)
+ {
+ if (active_insn_p (after) && ! INSN_LOCATOR (after))
+ INSN_LOCATOR (after) = loc;
+ if (after == last)
+ break;
+ after = NEXT_INSN (after);
+ }
+ }
return last;
}
*************** emit_jump_insn_after (rtx x, rtx after)
*** 4232,4237 ****
--- 4286,4303 ----
add_insn_after (last, after);
break;
}
+ if (active_insn_p (after) && INSN_LOCATOR (after))
+ {
+ int loc = INSN_LOCATOR (after);
+ while (1)
+ {
+ if (active_insn_p (after) && ! INSN_LOCATOR (after))
+ INSN_LOCATOR (after) = loc;
+ if (after == last)
+ break;
+ after = NEXT_INSN (after);
+ }
+ }
return last;
}
*************** emit_call_insn_after (rtx x, rtx after)
*** 4270,4275 ****
--- 4336,4353 ----
last = make_call_insn_raw (x);
add_insn_after (last, after);
break;
+ }
+ if (active_insn_p (after) && INSN_LOCATOR (after))
+ {
+ int loc = INSN_LOCATOR (after);
+ while (1)
+ {
+ if (active_insn_p (after) && ! INSN_LOCATOR (after))
+ INSN_LOCATOR (after) = loc;
+ if (after == last)
+ break;
+ after = NEXT_INSN (after);
+ }
}
return last;
More information about the Gcc
mailing list