[parisc-linux-cvs] gcc amodra
Alan Modra
alan@linuxcare.com.au
Mon, 26 Mar 2001 12:41:37 +1000 (EST)
On Sun, 25 Mar 2001, Alan Modra wrote:
> Enable dwarf2 debugging info...
> * dwarf2out.c (dwarf2out_line): Enable proper gas syntax.
> * config/pa/pa.h: Include linux.h before defining
> PREFERRED_DEBUGGING_TYPE so we actually can get DWARF2.
>
> Prepare for upstream merge.
> Cosmetic changes as far as we are concerned.
> * config/pa/pa.c: Replace #if DO_FRAME_NOTES with if (DO_FRAME_NOTES).
> (hppa_profile_hook): Use large model PIC references to count_label.
> * config/pa/pa.h (PROFILE_BEFORE_PROLOGUE): Delete.
> (ASM_OUTPUT_REG_PUSH): Delete.
> (ASM_OUTPUT_REG_POP): Delete.
Alan
--
Linuxcare
Index: gcc/dwarf2out.c
===================================================================
RCS file: /home/cvs/parisc/gcc/gcc/dwarf2out.c,v
retrieving revision 1.6
diff -u -p -r1.6 dwarf2out.c
--- dwarf2out.c 2001/03/23 04:23:21 1.6
+++ dwarf2out.c 2001/03/26 02:19:26
@@ -11653,13 +11653,13 @@ dwarf2out_line (filename, line)
if (DWARF2_ASM_LINE_DEBUG_INFO)
{
-#if 0
+#if 1
unsigned old_in_use = line_file_table.in_use;
#endif
unsigned file_num = lookup_filename (&line_file_table, filename);
/* Emit the .file and .loc directives understood by GNU as. */
-#if 0
+#if 1
/* ??? As of 2000-11-25, gas has a bug in which it doesn't
actually use the file number argument. It merely remembers
the last .file directive emitted. */
Index: gcc/config/pa/pa-linux.h
===================================================================
RCS file: /home/cvs/parisc/gcc/gcc/config/pa/pa-linux.h,v
retrieving revision 1.17
diff -u -p -r1.17 pa-linux.h
--- pa-linux.h 2001/02/19 13:54:41 1.17
+++ pa-linux.h 2001/03/26 02:19:31
@@ -22,14 +22,14 @@ Boston, MA 02111-1307, USA. */
other stuff from the tm_file definition in configure.in and just
include them manually here like i386 does. */
#undef SELECT_SECTION
+#include <linux.h>
/* Use DWARF2 debugging info and unwind. */
+#undef PREFERRED_DEBUGGING_TYPE
#define PREFERRED_DEBUGGING_TYPE DWARF2_DEBUG
#define DWARF2_ASM_LINE_DEBUG_INFO 1
#define DWARF2_UNWIND_INFO 1
-#include <linux.h>
-
#undef CPP_PREDEFINES
#define CPP_PREDEFINES "-D__ELF__ -Dunix -D__hppa__ -Dlinux -Asystem=unix -Asystem=posix -Acpu=hppa -Amachine=hppa -Amachine=bigendian"
@@ -95,20 +95,18 @@ Boston, MA 02111-1307, USA. */
if (write_symbols != NO_DEBUG) \
{ \
output_file_directive (FILE, main_input_filename); \
- fprintf (FILE, "\t.version\t\"01.01\"\n"); \
+ fputs ("\t.version\t\"01.01\"\n", FILE); \
} \
if (TARGET_64BIT) \
- { \
- fputs("\t.LEVEL 2.0w\n", FILE); \
- if (profile_flag) \
- fprintf (FILE, "\t.IMPORT _mcount, CODE\n"); \
- } \
+ fputs("\t.LEVEL 2.0w\n", FILE); \
else if (TARGET_PA_20) \
fputs("\t.LEVEL 2.0\n", FILE); \
else if (TARGET_PA_11) \
fputs("\t.LEVEL 1.1\n", FILE); \
else \
fputs("\t.LEVEL 1.0\n", FILE); \
+ if (profile_flag) \
+ fputs ("\t.IMPORT _mcount, CODE\n", FILE); \
} \
while (0)
Index: gcc/config/pa/pa.c
===================================================================
RCS file: /home/cvs/parisc/gcc/gcc/config/pa/pa.c,v
retrieving revision 1.14
diff -u -p -r1.14 pa.c
--- pa.c 2001/03/23 04:24:05 1.14
+++ pa.c 2001/03/26 02:20:02
@@ -2808,18 +2808,19 @@ store_reg (reg, disp, base)
dest = gen_rtx_MEM (word_mode, gen_rtx_LO_SUM (Pmode, tmpreg, delta));
i = emit_move_insn (dest, src);
}
-#if DO_FRAME_NOTES
- RTX_FRAME_RELATED_P (i) = 1;
- if (base != STACK_POINTER_REGNUM)
- {
- rtx addr = plus_constant (stack_pointer_rtx, disp - actual_fsize);
- dest = gen_rtx_MEM (word_mode, addr);
- REG_NOTES (i)
- = gen_rtx_EXPR_LIST (REG_FRAME_RELATED_EXPR,
- gen_rtx_SET (VOIDmode, dest, src),
- REG_NOTES (i));
+ if (DO_FRAME_NOTES)
+ {
+ RTX_FRAME_RELATED_P (i) = 1;
+ if (base != STACK_POINTER_REGNUM)
+ {
+ rtx addr = plus_constant (stack_pointer_rtx, disp - actual_fsize);
+ dest = gen_rtx_MEM (word_mode, addr);
+ REG_NOTES (i)
+ = gen_rtx_EXPR_LIST (REG_FRAME_RELATED_EXPR,
+ gen_rtx_SET (VOIDmode, dest, src),
+ REG_NOTES (i));
+ }
}
-#endif
}
/* Emit RTL to load REG from the memory location specified by BASE+DISP.
@@ -3038,26 +3039,27 @@ hppa_expand_prologue ()
insn = emit_move_insn (frame_pointer_rtx, stack_pointer_rtx);
if (VAL_14_BITS_P (actual_fsize))
{
- rtvec vec;
insn = emit_insn (gen_post_store (stack_pointer_rtx, tmpreg,
size_rtx));
-#if DO_FRAME_NOTES
- RTX_FRAME_RELATED_P (insn) = 1;
- vec = gen_rtvec (2,
- gen_rtx_SET (VOIDmode,
- gen_rtx_MEM (word_mode,
- stack_pointer_rtx),
- frame_pointer_rtx),
- gen_rtx_SET (VOIDmode,
- stack_pointer_rtx,
- gen_rtx_PLUS (word_mode,
- stack_pointer_rtx,
- size_rtx)));
- REG_NOTES (insn)
- = gen_rtx_EXPR_LIST (REG_FRAME_RELATED_EXPR,
- gen_rtx_SEQUENCE (VOIDmode, vec),
- REG_NOTES (insn));
-#endif
+ if (DO_FRAME_NOTES)
+ {
+ rtvec vec;
+ RTX_FRAME_RELATED_P (insn) = 1;
+ vec = gen_rtvec (2,
+ gen_rtx_SET (VOIDmode,
+ gen_rtx_MEM (word_mode,
+ stack_pointer_rtx),
+ frame_pointer_rtx),
+ gen_rtx_SET (VOIDmode,
+ stack_pointer_rtx,
+ gen_rtx_PLUS (word_mode,
+ stack_pointer_rtx,
+ size_rtx)));
+ REG_NOTES (insn)
+ = gen_rtx_EXPR_LIST (REG_FRAME_RELATED_EXPR,
+ gen_rtx_SEQUENCE (VOIDmode, vec),
+ REG_NOTES (insn));
+ }
}
else
{
@@ -3067,46 +3069,49 @@ hppa_expand_prologue ()
So instead use stwm to store at *sp and post-increment the
stack pointer as an atomic operation. Then increment sp to
finish allocating the new frame. */
- rtvec vec;
int adjust1 = 8192 - 64;
int adjust2 = actual_fsize - adjust1;
rtx delta = GEN_INT (adjust1);
insn = emit_insn (gen_post_store (stack_pointer_rtx, tmpreg,
delta));
-#if DO_FRAME_NOTES
- RTX_FRAME_RELATED_P (insn) = 1;
- vec = gen_rtvec (2,
- gen_rtx_SET (VOIDmode,
- gen_rtx_MEM (word_mode,
- stack_pointer_rtx),
- frame_pointer_rtx),
- gen_rtx_SET (VOIDmode,
- stack_pointer_rtx,
- gen_rtx_PLUS (word_mode,
- stack_pointer_rtx,
- delta)));
- REG_NOTES (insn)
- = gen_rtx_EXPR_LIST (REG_FRAME_RELATED_EXPR,
- gen_rtx_SEQUENCE (VOIDmode, vec),
- REG_NOTES (insn));
-#endif
- insn = set_reg_plus_d (STACK_POINTER_REGNUM,
- STACK_POINTER_REGNUM,
- adjust2);
-#if DO_FRAME_NOTES
- RTX_FRAME_RELATED_P (insn) = 1;
- if (! VAL_14_BITS_P (adjust2))
+ if (DO_FRAME_NOTES)
{
- rtx addr = plus_constant (stack_pointer_rtx, adjust2);
-
+ rtvec vec;
+ RTX_FRAME_RELATED_P (insn) = 1;
+ vec = gen_rtvec (2,
+ gen_rtx_SET (VOIDmode,
+ gen_rtx_MEM (word_mode,
+ stack_pointer_rtx),
+ frame_pointer_rtx),
+ gen_rtx_SET (VOIDmode,
+ stack_pointer_rtx,
+ gen_rtx_PLUS (word_mode,
+ stack_pointer_rtx,
+ delta)));
REG_NOTES (insn)
= gen_rtx_EXPR_LIST (REG_FRAME_RELATED_EXPR,
- gen_rtx_SET (VOIDmode,
- stack_pointer_rtx,
- addr),
+ gen_rtx_SEQUENCE (VOIDmode, vec),
REG_NOTES (insn));
}
-#endif
+
+ insn = set_reg_plus_d (STACK_POINTER_REGNUM,
+ STACK_POINTER_REGNUM,
+ adjust2);
+ if (DO_FRAME_NOTES)
+ {
+ RTX_FRAME_RELATED_P (insn) = 1;
+ if (! VAL_14_BITS_P (adjust2))
+ {
+ rtx addr = plus_constant (stack_pointer_rtx, adjust2);
+
+ REG_NOTES (insn)
+ = gen_rtx_EXPR_LIST (REG_FRAME_RELATED_EXPR,
+ gen_rtx_SET (VOIDmode,
+ stack_pointer_rtx,
+ addr),
+ REG_NOTES (insn));
+ }
+ }
}
/* Prevent register spills from being scheduled before the
stack pointer is raised. Necessary as we will be storing
@@ -3130,20 +3135,21 @@ hppa_expand_prologue ()
insn = set_reg_plus_d (STACK_POINTER_REGNUM,
STACK_POINTER_REGNUM,
actual_fsize);
-#if DO_FRAME_NOTES
- RTX_FRAME_RELATED_P (insn) = 1;
- if (! VAL_14_BITS_P (actual_fsize))
+ if (DO_FRAME_NOTES)
{
- rtx addr = plus_constant (stack_pointer_rtx, actual_fsize);
-
- REG_NOTES (insn)
- = gen_rtx_EXPR_LIST (REG_FRAME_RELATED_EXPR,
- gen_rtx_SET (VOIDmode,
- stack_pointer_rtx,
- addr),
- REG_NOTES (insn));
+ RTX_FRAME_RELATED_P (insn) = 1;
+ if (! VAL_14_BITS_P (actual_fsize))
+ {
+ rtx addr;
+ addr = plus_constant (stack_pointer_rtx, actual_fsize);
+ REG_NOTES (insn)
+ = gen_rtx_EXPR_LIST (REG_FRAME_RELATED_EXPR,
+ gen_rtx_SET (VOIDmode,
+ stack_pointer_rtx,
+ addr),
+ REG_NOTES (insn));
+ }
}
-#endif
}
}
}
@@ -3179,17 +3185,20 @@ hppa_expand_prologue ()
insn = emit_insn (gen_post_store (stack_pointer_rtx,
gen_rtx_REG (word_mode, i),
delta));
-#if DO_FRAME_NOTES
- RTX_FRAME_RELATED_P (insn) = 1;
- REG_NOTES (insn)
- = gen_rtx_EXPR_LIST (REG_FRAME_RELATED_EXPR,
- gen_rtx_SET (VOIDmode,
- stack_pointer_rtx,
- gen_rtx_PLUS (word_mode,
- stack_pointer_rtx,
- delta)),
- REG_NOTES (insn));
-#endif
+ if (DO_FRAME_NOTES)
+ {
+ rtx set;
+ RTX_FRAME_RELATED_P (insn) = 1;
+ set = gen_rtx_SET (VOIDmode,
+ stack_pointer_rtx,
+ gen_rtx_PLUS (word_mode,
+ stack_pointer_rtx,
+ delta));
+ REG_NOTES (insn)
+ = gen_rtx_EXPR_LIST (REG_FRAME_RELATED_EXPR,
+ set,
+ REG_NOTES (insn));
+ }
}
else
store_reg (i, offset, STACK_POINTER_REGNUM);
@@ -3204,9 +3213,8 @@ hppa_expand_prologue ()
insn = set_reg_plus_d (STACK_POINTER_REGNUM,
STACK_POINTER_REGNUM,
actual_fsize);
-#if DO_FRAME_NOTES
- RTX_FRAME_RELATED_P (insn) = 1;
-#endif
+ if (DO_FRAME_NOTES)
+ RTX_FRAME_RELATED_P (insn) = 1;
}
}
@@ -3238,24 +3246,26 @@ hppa_expand_prologue ()
if (regs_ever_live[i]
|| (! TARGET_64BIT && regs_ever_live[i + 1]))
{
- rtx addr, reg, stackoff;
+ rtx addr, reg;
addr = gen_rtx_MEM (DFmode, gen_rtx_POST_INC (DFmode, tmpreg));
reg = gen_rtx_REG (DFmode, i);
insn = emit_move_insn (addr, reg);
-#if DO_FRAME_NOTES
- RTX_FRAME_RELATED_P (insn) = 1;
- stackoff = GEN_INT (offset + (frame_pointer_needed
- ? -actual_fsize : 0));
- addr = gen_rtx_MEM (DFmode,
- gen_rtx_PLUS (DFmode,
- stack_pointer_rtx,
- stackoff));
- REG_NOTES (insn)
- = gen_rtx_EXPR_LIST (REG_FRAME_RELATED_EXPR,
- gen_rtx_SET (VOIDmode, addr, reg),
- REG_NOTES (insn));
- offset += 8;
-#endif
+ if (DO_FRAME_NOTES)
+ {
+ rtx stackoff;
+ RTX_FRAME_RELATED_P (insn) = 1;
+ stackoff = GEN_INT (offset + (frame_pointer_needed
+ ? -actual_fsize : 0));
+ addr = gen_rtx_MEM (DFmode,
+ gen_rtx_PLUS (DFmode,
+ stack_pointer_rtx,
+ stackoff));
+ REG_NOTES (insn)
+ = gen_rtx_EXPR_LIST (REG_FRAME_RELATED_EXPR,
+ gen_rtx_SET (VOIDmode, addr, reg),
+ REG_NOTES (insn));
+ offset += 8;
+ }
fr_saved++;
}
}
@@ -3395,39 +3405,41 @@ hppa_expand_epilogue ()
pointer is initially set to fp + 64 to avoid a race condition. */
if (frame_pointer_needed)
{
- rtvec vec;
rtx delta = GEN_INT (-64);
insn = set_reg_plus_d (STACK_POINTER_REGNUM, FRAME_POINTER_REGNUM, 64);
-#if DO_FRAME_NOTES
- RTX_FRAME_RELATED_P (insn) = 1;
- REG_NOTES (insn)
- = gen_rtx_EXPR_LIST (REG_FRAME_RELATED_EXPR,
- gen_rtx_SET (VOIDmode,
- stack_pointer_rtx,
- plus_constant (stack_pointer_rtx,
- 64 - actual_fsize)),
- REG_NOTES (insn));
-#endif
+ if (DO_FRAME_NOTES)
+ {
+ RTX_FRAME_RELATED_P (insn) = 1;
+ REG_NOTES (insn)
+ = gen_rtx_EXPR_LIST (REG_FRAME_RELATED_EXPR,
+ gen_rtx_SET (VOIDmode,
+ stack_pointer_rtx,
+ plus_constant (stack_pointer_rtx,
+ 64 - actual_fsize)),
+ REG_NOTES (insn));
+ }
insn = emit_insn (gen_pre_load (frame_pointer_rtx,
stack_pointer_rtx,
delta));
-#if DO_FRAME_NOTES
- RTX_FRAME_RELATED_P (insn) = 1;
- vec = gen_rtvec (2,
- gen_rtx_SET (VOIDmode,
- stack_pointer_rtx,
- gen_rtx_PLUS (word_mode,
- stack_pointer_rtx,
- delta)),
- gen_rtx_SET (VOIDmode,
- frame_pointer_rtx,
- gen_rtx_MEM (word_mode,
- stack_pointer_rtx)));
- REG_NOTES (insn)
- = gen_rtx_EXPR_LIST (REG_FRAME_RELATED_EXPR,
- gen_rtx_SEQUENCE (VOIDmode, vec),
- REG_NOTES (insn));
-#endif
+ if (DO_FRAME_NOTES)
+ {
+ rtvec vec;
+ RTX_FRAME_RELATED_P (insn) = 1;
+ vec = gen_rtvec (2,
+ gen_rtx_SET (VOIDmode,
+ stack_pointer_rtx,
+ gen_rtx_PLUS (word_mode,
+ stack_pointer_rtx,
+ delta)),
+ gen_rtx_SET (VOIDmode,
+ frame_pointer_rtx,
+ gen_rtx_MEM (word_mode,
+ stack_pointer_rtx)));
+ REG_NOTES (insn)
+ = gen_rtx_EXPR_LIST (REG_FRAME_RELATED_EXPR,
+ gen_rtx_SEQUENCE (VOIDmode, vec),
+ REG_NOTES (insn));
+ }
}
/* If we were deferring a callee register restore, do it now. */
else if (merge_sp_adjust_with_load)
@@ -3437,37 +3449,39 @@ hppa_expand_epilogue ()
merge_sp_adjust_with_load),
stack_pointer_rtx,
delta));
-#if DO_FRAME_NOTES
- RTX_FRAME_RELATED_P (insn) = 1;
- REG_NOTES (insn)
- = gen_rtx_EXPR_LIST (REG_FRAME_RELATED_EXPR,
- gen_rtx_SET (VOIDmode,
- stack_pointer_rtx,
- gen_rtx_PLUS (word_mode,
- stack_pointer_rtx,
- delta)),
- REG_NOTES (insn));
-#endif
+ if (DO_FRAME_NOTES)
+ {
+ RTX_FRAME_RELATED_P (insn) = 1;
+ REG_NOTES (insn)
+ = gen_rtx_EXPR_LIST (REG_FRAME_RELATED_EXPR,
+ gen_rtx_SET (VOIDmode,
+ stack_pointer_rtx,
+ gen_rtx_PLUS (word_mode,
+ stack_pointer_rtx,
+ delta)),
+ REG_NOTES (insn));
+ }
}
else if (actual_fsize != 0)
{
insn = set_reg_plus_d (STACK_POINTER_REGNUM,
STACK_POINTER_REGNUM,
- actual_fsize);
-#if DO_FRAME_NOTES
- RTX_FRAME_RELATED_P (insn) = 1;
- if (! VAL_14_BITS_P (- actual_fsize))
+ if (DO_FRAME_NOTES)
{
- rtx addr = plus_constant (stack_pointer_rtx, - actual_fsize);
+ RTX_FRAME_RELATED_P (insn) = 1;
+ if (! VAL_14_BITS_P (- actual_fsize))
+ {
+ rtx addr = plus_constant (stack_pointer_rtx, - actual_fsize);
- REG_NOTES (insn)
- = gen_rtx_EXPR_LIST (REG_FRAME_RELATED_EXPR,
- gen_rtx_SET (VOIDmode,
- stack_pointer_rtx,
- addr),
- REG_NOTES (insn));
+ REG_NOTES (insn)
+ = gen_rtx_EXPR_LIST (REG_FRAME_RELATED_EXPR,
+ gen_rtx_SET (VOIDmode,
+ stack_pointer_rtx,
+ addr),
+ REG_NOTES (insn));
+ }
}
-#endif
}
/* If we haven't restored %r2 yet (no frame pointer, and a stack
@@ -3526,21 +3540,15 @@ void hppa_profile_hook (label_no)
if (flag_pic)
{
+ rtx tmpreg;
+
current_function_uses_pic_offset_table = 1;
- if (TARGET_64BIT)
- {
- rtx tmpreg = gen_rtx_REG (Pmode, 1);
- emit_move_insn (tmpreg,
- gen_rtx_PLUS (Pmode, pic_offset_table_rtx,
- gen_rtx_HIGH (Pmode,
- count_label_rtx)));
- addr = gen_rtx_LO_SUM (Pmode, tmpreg, count_label_rtx);
- }
- else
- {
- addr = gen_rtx_PLUS (Pmode, pic_offset_table_rtx, count_label_rtx);
- }
- addr = gen_rtx_MEM (Pmode, addr);
+ tmpreg = gen_rtx_REG (Pmode, 1);
+ emit_move_insn (tmpreg,
+ gen_rtx_PLUS (Pmode, pic_offset_table_rtx,
+ gen_rtx_HIGH (Pmode, count_label_rtx)));
+ addr = gen_rtx_MEM (Pmode,
+ gen_rtx_LO_SUM (Pmode, tmpreg, count_label_rtx));
}
else
{
Index: gcc/config/pa/pa.h
===================================================================
RCS file: /home/cvs/parisc/gcc/gcc/config/pa/pa.h,v
retrieving revision 1.9
diff -u -p -r1.9 pa.h
--- pa.h 2001/03/23 04:24:05 1.9
+++ pa.h 2001/03/26 02:20:19
@@ -888,11 +888,12 @@ extern enum cmp_type hppa_branch_type;
#define FUNCTION_PROLOGUE(FILE, SIZE) \
output_function_prologue (FILE, SIZE)
-#define PROFILE_BEFORE_PROLOGUE
+/* On HPPA, we emit profiling code as rtl via PROFILE_HOOK rather than
+ as assembly via FUNCTION_PROFILER. */
+
#define FUNCTION_PROFILER(FILE, LABEL) /* nothing */
-#define PROFILE_HOOK(label_no) \
- hppa_profile_hook (label_no)
+#define PROFILE_HOOK(label_no) hppa_profile_hook (label_no)
void hppa_profile_hook PARAMS ((int label_no));
/* EXIT_IGNORE_STACK should be nonzero if, when returning from a function,
@@ -1837,8 +1838,6 @@ while (0)
#define ASM_OUTPUT_ASCII(FILE, P, SIZE) \
output_ascii ((FILE), (P), (SIZE))
-#define ASM_OUTPUT_REG_PUSH(FILE,REGNO)
-#define ASM_OUTPUT_REG_POP(FILE,REGNO)
/* This is how to output an element of a case-vector that is absolute.
Note that this method makes filling these branch delay slots
impossible. */