+2003-06-15 Nathan Sidwell <nathan@codesourcery.com>
+
+ * function.h (struct emit_status): Remove x_last_linenum,
+ x_last_filename. Add x_last_location.
+ * rtl.h: #include "input.h".
+ (NOTE_DATA): New.
+ * cfglayout.c (duplicate_insn_chain): Use emit_line_note for line
+ number notes.
+ * emit-rtl.c (last_linenum, last_filename): Remove.
+ (last_location): New.
+ (emit_line_note_after): LINE must always be >= 0.
+ (emit_line_note): Likewise. Check not duplicate here...
+ (emit_note): ... rather than here.
+ (emit_line_note_force, force_next_line_note, init_emit): Adjust.
+ * integrate.c (expand_inline_function): Use emit_line_note for
+ line number notes.
+ (copy_insn_list): Likewise.
+ * unroll.c (copy_loop_body): Likewise.
+ * Makefile.in (RTL_H): Add input.h.
+
2003-06-16 Richard Sandiford <rsandifo@redhat.com>
* optabs.c (emit_libcall_block): Don't hoist insns past a label.
* c.opt: Specify languages.
* opts.h: Remove languages.
* opts.sh: Recognise front-end defined languages.
-doc:
- * sourcebuild.texi: Update.
+ * doc/sourcebuild.texi: Update.
2003-06-15 Andreas Jaeger <aj@suse.de>
TARGET_DEF_H = target-def.h $(HOOKS_H)
MACHMODE_H = machmode.h machmode.def @extra_modes_file@
RTL_BASE_H = rtl.h rtl.def $(MACHMODE_H)
-RTL_H = $(RTL_BASE_H) genrtl.h
+RTL_H = $(RTL_BASE_H) genrtl.h input.h
PARAMS_H = params.h params.def
TREE_H = tree.h tree.def $(MACHMODE_H) tree-check.h version.h builtins.def \
input.h
abort ();
break;
case NOTE_INSN_REPEATED_LINE_NUMBER:
- emit_note (NOTE_SOURCE_FILE (insn), NOTE_LINE_NUMBER (insn));
+ emit_line_note (NOTE_SOURCE_FILE (insn),
+ NOTE_LINE_NUMBER (insn));
break;
default:
abort ();
/* It is possible that no_line_number is set and the note
won't be emitted. */
- emit_note (NOTE_SOURCE_FILE (insn), NOTE_LINE_NUMBER (insn));
+ emit_line_note (NOTE_SOURCE_FILE (insn),
+ NOTE_LINE_NUMBER (insn));
}
break;
default:
#define first_insn (cfun->emit->x_first_insn)
#define last_insn (cfun->emit->x_last_insn)
#define cur_insn_uid (cfun->emit->x_cur_insn_uid)
-#define last_linenum (cfun->emit->x_last_linenum)
-#define last_filename (cfun->emit->x_last_filename)
+#define last_location (cfun->emit->x_last_location)
#define first_label_num (cfun->emit->x_first_label_num)
static rtx make_jump_insn_raw PARAMS ((rtx));
{
rtx note;
- if (no_line_numbers && line > 0)
+ if (line < 0)
+ abort ();
+ if (no_line_numbers)
{
cur_insn_uid++;
return 0;
const char *file;
int line;
{
+ if (line < 0)
+ abort ();
+
set_file_and_line_for_stmt (file, line);
-#if 0
+ if (file && last_location.file && !strcmp (file, last_location.file)
+ && line == last_location.line)
+ return NULL_RTX;
+ last_location.file = file;
+ last_location.line = line;
+
if (no_line_numbers)
- return 0;
-#endif
+ {
+ cur_insn_uid++;
+ return NULL_RTX;
+ }
return emit_note (file, line);
}
{
rtx note;
- if (line > 0)
- {
- if (file && last_filename && !strcmp (file, last_filename)
- && line == last_linenum)
- return 0;
- last_filename = file;
- last_linenum = line;
- }
-
- if (no_line_numbers && line > 0)
- {
- cur_insn_uid++;
- return 0;
- }
-
note = rtx_alloc (NOTE);
INSN_UID (note) = cur_insn_uid++;
NOTE_SOURCE_FILE (note) = file;
const char *file;
int line;
{
- last_linenum = -1;
+ last_location.line = -1;
return emit_line_note (file, line);
}
void
force_next_line_note ()
{
- last_linenum = -1;
+ last_location.line = -1;
}
/* Place a note of KIND on insn INSN with DATUM as the datum. If a
seq_rtl_expr = NULL;
cur_insn_uid = 1;
reg_rtx_no = LAST_VIRTUAL_REGISTER + 1;
- last_linenum = 0;
- last_filename = 0;
+ last_location.line = 0;
+ last_location.file = 0;
first_label_num = label_num;
last_label_num = 0;
seq_stack = NULL;
Reset to 1 for each function compiled. */
int x_cur_insn_uid;
- /* Line number and source file of the last line-number NOTE emitted.
+ /* Location the last line-number NOTE emitted.
This is used to avoid generating duplicates. */
- int x_last_linenum;
- const char *x_last_filename;
+ location_t x_last_location;
/* The length of the regno_pointer_align, regno_decl, and x_regno_reg_rtx
vectors. Since these vectors are needed during the expansion phase when
if (GET_CODE (parm_insns) == NOTE
&& NOTE_LINE_NUMBER (parm_insns) > 0)
{
- rtx note = emit_note (NOTE_SOURCE_FILE (parm_insns),
- NOTE_LINE_NUMBER (parm_insns));
+ rtx note = emit_line_note (NOTE_SOURCE_FILE (parm_insns),
+ NOTE_LINE_NUMBER (parm_insns));
if (note)
RTX_INTEGRATED_P (note) = 1;
}
&& ! (GET_CODE (XEXP (loc, 0)) == REG
&& REGNO (XEXP (loc, 0)) > LAST_VIRTUAL_REGISTER))
{
- rtx note = emit_note (DECL_SOURCE_FILE (formal),
- DECL_SOURCE_LINE (formal));
+ rtx note = emit_line_note (DECL_SOURCE_FILE (formal),
+ DECL_SOURCE_LINE (formal));
if (note)
RTX_INTEGRATED_P (note) = 1;
This line number note is still needed for debugging though, so we can't
delete it. */
if (flag_test_coverage)
- emit_note (0, NOTE_INSN_REPEATED_LINE_NUMBER);
+ emit_note (NULL, NOTE_INSN_REPEATED_LINE_NUMBER);
emit_line_note (input_filename, input_line);
NOTE_INSN_DELETED notes aren't useful. */
- if (NOTE_LINE_NUMBER (insn) != NOTE_INSN_FUNCTION_END
+ if (NOTE_LINE_NUMBER (insn) > 0)
+ copy = emit_line_note (NOTE_SOURCE_FILE (insn),
+ NOTE_LINE_NUMBER (insn));
+ else if (NOTE_LINE_NUMBER (insn) != NOTE_INSN_FUNCTION_END
&& NOTE_LINE_NUMBER (insn) != NOTE_INSN_FUNCTION_BEG
&& NOTE_LINE_NUMBER (insn) != NOTE_INSN_DELETED)
{
- copy = emit_note (NOTE_SOURCE_FILE (insn),
- NOTE_LINE_NUMBER (insn));
- if (copy
- && (NOTE_LINE_NUMBER (copy) == NOTE_INSN_BLOCK_BEG
- || NOTE_LINE_NUMBER (copy) == NOTE_INSN_BLOCK_END)
+ copy = emit_note (NULL, NOTE_LINE_NUMBER (insn));
+ NOTE_DATA (copy) = NOTE_DATA (insn);
+ if ((NOTE_LINE_NUMBER (copy) == NOTE_INSN_BLOCK_BEG
+ || NOTE_LINE_NUMBER (copy) == NOTE_INSN_BLOCK_END)
&& NOTE_BLOCK (insn))
{
tree *mapped_block_p;
else
NOTE_BLOCK (copy) = *mapped_block_p;
}
- else if (copy
- && NOTE_LINE_NUMBER (copy) == NOTE_INSN_EXPECTED_VALUE)
+ else if (NOTE_LINE_NUMBER (copy) == NOTE_INSN_EXPECTED_VALUE)
NOTE_EXPECTED_VALUE (copy)
= copy_rtx_and_substitute (NOTE_EXPECTED_VALUE (insn),
map, 0);
struct function;
#include "machmode.h"
+#include "input.h"
#undef FFS /* Some systems predefine this symbol; don't let it interfere. */
#undef FLOAT /* Likewise. */
between ints and pointers if we use a different macro for the block number.)
*/
+/* Opaque data. */
+#define NOTE_DATA(INSN) XCINT (INSN, 4, NOTE)
#define NOTE_SOURCE_FILE(INSN) XCSTR (INSN, 4, NOTE)
#define NOTE_BLOCK(INSN) XCTREE (INSN, 4, NOTE)
#define NOTE_EH_HANDLER(INSN) XCINT (INSN, 4, NOTE)
extern rtx assign_stack_temp_for_type PARAMS ((enum machine_mode,
HOST_WIDE_INT, int, tree));
extern rtx assign_temp PARAMS ((tree, int, int, int));
+
/* In emit-rtl.c */
extern rtx emit_insn_before PARAMS ((rtx, rtx));
extern rtx emit_insn_before_setloc PARAMS ((rtx, rtx, int));
the associated rtl. We do not want to share the structure in
this new block. */
- if (NOTE_LINE_NUMBER (insn) != NOTE_INSN_DELETED
- && NOTE_LINE_NUMBER (insn) != NOTE_INSN_DELETED_LABEL
- && NOTE_LINE_NUMBER (insn) != NOTE_INSN_BASIC_BLOCK
- && ((NOTE_LINE_NUMBER (insn) != NOTE_INSN_LOOP_VTOP
- && NOTE_LINE_NUMBER (insn) != NOTE_INSN_LOOP_CONT)
- || (last_iteration && unroll_type != UNROLL_COMPLETELY)))
- copy = emit_note (NOTE_SOURCE_FILE (insn),
+ if (NOTE_LINE_NUMBER (insn) > 0)
+ copy = emit_line_note (NOTE_SOURCE_FILE (insn),
NOTE_LINE_NUMBER (insn));
+ else if (NOTE_LINE_NUMBER (insn) != NOTE_INSN_DELETED
+ && NOTE_LINE_NUMBER (insn) != NOTE_INSN_DELETED_LABEL
+ && NOTE_LINE_NUMBER (insn) != NOTE_INSN_BASIC_BLOCK
+ && ((NOTE_LINE_NUMBER (insn) != NOTE_INSN_LOOP_VTOP
+ && NOTE_LINE_NUMBER (insn) != NOTE_INSN_LOOP_CONT)
+ || (last_iteration
+ && unroll_type != UNROLL_COMPLETELY)))
+ {
+ copy = emit_note (NULL, NOTE_LINE_NUMBER (insn));
+ NOTE_DATA (copy) = NOTE_DATA (insn);
+ }
else
copy = 0;
break;
instructions before the last insn in the loop, COPY_NOTES_FROM
can be a NOTE_INSN_LOOP_CONT note if there is no VTOP note,
as in a do .. while loop. */
- if (GET_CODE (insn) == NOTE
- && NOTE_LINE_NUMBER (insn) != NOTE_INSN_DELETED
- && NOTE_LINE_NUMBER (insn) != NOTE_INSN_BASIC_BLOCK
- && NOTE_LINE_NUMBER (insn) != NOTE_INSN_LOOP_VTOP
- && NOTE_LINE_NUMBER (insn) != NOTE_INSN_LOOP_CONT)
- emit_note (NOTE_SOURCE_FILE (insn), NOTE_LINE_NUMBER (insn));
+ if (GET_CODE (insn) != NOTE)
+ /*NOP*/;
+ else if (NOTE_LINE_NUMBER (insn) > 0)
+ emit_line_note (NOTE_SOURCE_FILE (insn), NOTE_LINE_NUMBER (insn));
+ else if (NOTE_LINE_NUMBER (insn) != NOTE_INSN_DELETED
+ && NOTE_LINE_NUMBER (insn) != NOTE_INSN_BASIC_BLOCK
+ && NOTE_LINE_NUMBER (insn) != NOTE_INSN_LOOP_VTOP
+ && NOTE_LINE_NUMBER (insn) != NOTE_INSN_LOOP_CONT)
+ {
+ rtx copy = emit_note (NULL, NOTE_LINE_NUMBER (insn));
+ NOTE_DATA (copy) = NOTE_DATA (insn);
+ }
}
}