aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Stallman <rms@gnu.org>1992-10-03 02:30:30 +0000
committerRichard Stallman <rms@gnu.org>1992-10-03 02:30:30 +0000
commit52cdd5e580a96def08cf06487a338b26069999d9 (patch)
tree467f7323d09fd5a790152adb0319e4395df12130
parent36ad49159d5e11f853f9ee5b929b61125e6807d7 (diff)
downloadgcc-52cdd5e580a96def08cf06487a338b26069999d9.zip
gcc-52cdd5e580a96def08cf06487a338b26069999d9.tar.gz
gcc-52cdd5e580a96def08cf06487a338b26069999d9.tar.bz2
(output_mem_loc_descriptor, output_loc_descriptor):
Catch cases of bogus DECL_RTL values involving pseudo-regs (for all target systems) and print an annoying message if we ever see such a case. From-SVN: r2311
-rw-r--r--gcc/dwarfout.c35
1 files changed, 27 insertions, 8 deletions
diff --git a/gcc/dwarfout.c b/gcc/dwarfout.c
index d282329..6535084 100644
--- a/gcc/dwarfout.c
+++ b/gcc/dwarfout.c
@@ -1474,11 +1474,11 @@ output_mem_loc_descriptor (rtl)
/* Whenever a register number forms a part of the description of
the method for calculating the (dynamic) address of a memory
- resident object, Dwarf rules require the register number to
+ resident object, DWARF rules require the register number to
be referred to as a "base register". This distinction is not
based in any way upon what category of register the hardware
believes the given register belongs to. This is strictly
- Dwarf terminology we're dealing with here.
+ DWARF terminology we're dealing with here. */
Note that in cases where the location of a memory-resident data
object could be expressed as:
@@ -1489,12 +1489,21 @@ output_mem_loc_descriptor (rtl)
be OP_BASEREG (basereg). This may look deceptively like the
object in question was allocated to a register (rather than
in memory) so DWARF consumers need to be aware of the subtle
- distinction between OP_REG and OP_BASEREG.
- */
+ distinction between OP_REG and OP_BASEREG. */
ASM_OUTPUT_DWARF_STACK_OP (asm_out_file, OP_BASEREG);
- ASM_OUTPUT_DWARF_DATA4 (asm_out_file,
- DBX_REGISTER_NUMBER (REGNO (rtl)));
+ {
+ register unsigned regno = REGNO (rtl);
+
+ if (regno >= FIRST_PSEUDO_REGISTER)
+ {
+ fprintf (stderr, "%s: regno botch detected: dwarfout.c:%u\n",
+ language_string, __LINE__);
+ debug_rtx(rtl);
+ regno = 0;
+ }
+ ASM_OUTPUT_DWARF_DATA4 (asm_out_file, DBX_REGISTER_NUMBER (regno));
+ }
break;
case MEM:
@@ -1549,8 +1558,18 @@ output_loc_descriptor (rtl)
case REG:
ASM_OUTPUT_DWARF_STACK_OP (asm_out_file, OP_REG);
- ASM_OUTPUT_DWARF_DATA4 (asm_out_file,
- DBX_REGISTER_NUMBER (REGNO (rtl)));
+ {
+ register unsigned regno = REGNO (rtl);
+
+ if (regno >= FIRST_PSEUDO_REGISTER)
+ {
+ fprintf (stderr, "%s: regno botch detected: dwarfout.c:%u\n",
+ language_string, __LINE__);
+ debug_rtx(rtl);
+ regno = 0;
+ }
+ ASM_OUTPUT_DWARF_DATA4 (asm_out_file, DBX_REGISTER_NUMBER (regno));
+ }
break;
case MEM: