From 8063ddcf237c3bb42fc0b09d19dad816d0dc0b28 Mon Sep 17 00:00:00 2001 From: Richard Henderson Date: Thu, 11 Oct 2001 10:46:53 -0700 Subject: [PATCH] dwarf2out.c (rtl_for_decl_location): If no DECL_RTL, look for a DECL_INITIAL. * dwarf2out.c (rtl_for_decl_location): If no DECL_RTL, look for a DECL_INITIAL. From-SVN: r46193 --- gcc/ChangeLog | 5 +++++ gcc/dwarf2out.c | 10 ++++++++++ 2 files changed, 15 insertions(+) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 71aa87c4f61..7d8a498ee75 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2001-10-11 Richard Henderson + + * dwarf2out.c (rtl_for_decl_location): If no DECL_RTL, look + for a DECL_INITIAL. + 2001-10-11 David Edelsohn * config/rs6000/xcoff.h (UNALIGNED_DOUBLE_INT_ASM_OP): Only diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c index e8a5f18f0d0..275e5b41fb2 100644 --- a/gcc/dwarf2out.c +++ b/gcc/dwarf2out.c @@ -8567,6 +8567,16 @@ rtl_for_decl_location (decl) #endif } + /* A variable with no DECL_RTL but a DECL_INITIAL is a compile-time + constant, and will have been substituted directly into all + expressions that use it. C does not have such a concept, but + C++ and other languages do. */ + else if (DECL_INITIAL (decl)) + { + rtl = expand_expr (DECL_INITIAL (decl), NULL_RTX, VOIDmode, + EXPAND_INITIALIZER); + } + return rtl; }