simplify-rtx.c (avoid_constant_pool_reference): Export.
authorRichard Henderson <rth@redhat.com>
Thu, 26 Jul 2001 23:47:15 +0000 (16:47 -0700)
committerRichard Henderson <rth@gcc.gnu.org>
Thu, 26 Jul 2001 23:47:15 +0000 (16:47 -0700)
        * simplify-rtx.c (avoid_constant_pool_reference): Export.
        * rtl.h (avoid_constant_pool_reference): Declare it.
        * dwarf2out.c (add_location_or_const_value_attribute): Use it.
        (add_const_value_attribute): Use add_AT_unsigned for unsigned values.

From-SVN: r44411

gcc/ChangeLog
gcc/dwarf2out.c
gcc/rtl.h
gcc/simplify-rtx.c

index fddead1cf2ebc561bedb1857b40461e2f5cec696..08f8c66de13c977ac1f8ce7bb64d4de232f5a6fa 100644 (file)
@@ -1,3 +1,10 @@
+2001-07-26  Richard Henderson  <rth@redhat.com>
+
+       * simplify-rtx.c (avoid_constant_pool_reference): Export.
+       * rtl.h (avoid_constant_pool_reference): Declare it.
+       * dwarf2out.c (add_location_or_const_value_attribute): Use it.
+       (add_const_value_attribute): Use add_AT_unsigned for unsigned values.
+
 Thu Jul 26 22:30:22 CEST 2001  Jan Hubicka  <jh@suse.cz>
 
        * rtl.h (cleanup_barriers): Declare.
index 13a7e57c81ee6d02c65693f2c2c571634fa7a95b..b31eaa82a9f7b1f94b6f00ef5411e8049f42ba37 100644 (file)
@@ -8215,7 +8215,7 @@ add_const_value_attribute (die, rtl)
          {
            if ((unsigned long) val != (unsigned HOST_WIDE_INT) val)
              abort ();
-           add_AT_int (die, DW_AT_const_value, (unsigned long) val);
+           add_AT_unsigned (die, DW_AT_const_value, (unsigned long) val);
          }
       }
       break;
@@ -8474,6 +8474,11 @@ add_location_or_const_value_attribute (die, decl)
   if (rtl == NULL_RTX)
     return;
 
+  /* If we don't look past the constant pool, we risk emitting a
+     reference to a constant pool entry that isn't referenced from
+     code, and thus is not emitted.  */
+  rtl = avoid_constant_pool_reference (rtl);
+
   switch (GET_CODE (rtl))
     {
     case ADDRESSOF:
index 7cacfabcccacb51ac3eed226f2462101fe8eea30..e7fdc98a71557bfee276ba5f7131e18806ffeb32 100644 (file)
--- a/gcc/rtl.h
+++ b/gcc/rtl.h
@@ -1345,6 +1345,7 @@ extern rtx simplify_gen_subreg            PARAMS ((enum machine_mode,
                                                 unsigned int));
 extern rtx simplify_replace_rtx                PARAMS ((rtx, rtx, rtx));
 extern rtx simplify_rtx                        PARAMS ((rtx));
+extern rtx avoid_constant_pool_reference PARAMS ((rtx));
 
 /* In function.c  */
 extern rtx gen_mem_addressof           PARAMS ((rtx, union tree_node *));
index 1961f194ebac00c206a93135b56452014d703aa6..1a6f30696d59d7afec0d114ed08d0b84e0d6a988 100644 (file)
@@ -99,7 +99,6 @@ Boston, MA 02111-1307, USA.  */
 static rtx simplify_plus_minus         PARAMS ((enum rtx_code,
                                                 enum machine_mode, rtx, rtx));
 static void check_fold_consts          PARAMS ((PTR));
-static rtx avoid_constant_pool_reference PARAMS ((rtx));
 \f
 /* Make a binary operation by properly ordering the operands and 
    seeing if the expression folds.  */
@@ -138,7 +137,7 @@ simplify_gen_binary (code, mode, op0, op1)
 \f
 /* If X is a MEM referencing the constant pool, return the real value.
    Otherwise return X.  */
-static rtx
+rtx
 avoid_constant_pool_reference (x)
      rtx x;
 {