diff options
author | Richard Henderson <rth@redhat.com> | 2000-11-25 16:40:46 -0800 |
---|---|---|
committer | Richard Henderson <rth@gcc.gnu.org> | 2000-11-25 16:40:46 -0800 |
commit | 3645c4dc1cf004887905411ca81590b75c665529 (patch) | |
tree | a74ebbf1036c73a5188ef798a86d1ddd9dded390 | |
parent | a17a58505dd750d28a77e2fd443e32909a3c2079 (diff) | |
download | gcc-3645c4dc1cf004887905411ca81590b75c665529.zip gcc-3645c4dc1cf004887905411ca81590b75c665529.tar.gz gcc-3645c4dc1cf004887905411ca81590b75c665529.tar.bz2 |
c-common.h (DECL_C_HARD_REGISTER): New.
* c-common.h (DECL_C_HARD_REGISTER): New.
* c-decl.c (finish_decl): Set it for asm register variables.
* c-semantics.c (emit_local_var): Test it when instantiating one.
From-SVN: r37748
-rw-r--r-- | gcc/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/c-common.h | 4 | ||||
-rw-r--r-- | gcc/c-decl.c | 5 | ||||
-rw-r--r-- | gcc/c-semantics.c | 6 |
4 files changed, 17 insertions, 4 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 33f3d53..e6497ee 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,5 +1,11 @@ 2000-11-25 Richard Henderson <rth@redhat.com> + * c-common.h (DECL_C_HARD_REGISTER): New. + * c-decl.c (finish_decl): Set it for asm register variables. + * c-semantics.c (emit_local_var): Test it when instantiating one. + +2000-11-25 Richard Henderson <rth@redhat.com> + * c-decl.c (c_expand_body): Use DECL_SOURCE_LINE rather than lineno for the start of the function. diff --git a/gcc/c-common.h b/gcc/c-common.h index b27c760..94c89cf 100644 --- a/gcc/c-common.h +++ b/gcc/c-common.h @@ -686,6 +686,10 @@ extern int anon_aggr_type_p PARAMS ((tree)); #define CLEAR_DECL_C_BIT_FIELD(NODE) \ (DECL_LANG_FLAG_4 (FIELD_DECL_CHECK (NODE)) = 0) +/* In a VAR_DECL, nonzero if the decl is a register variable with + an explicit asm specification. */ +#define DECL_C_HARD_REGISTER(DECL) DECL_LANG_FLAG_4 (VAR_DECL_CHECK (DECL)) + extern void emit_local_var PARAMS ((tree)); extern void make_rtl_for_local_static PARAMS ((tree)); extern tree expand_cond PARAMS ((tree)); diff --git a/gcc/c-decl.c b/gcc/c-decl.c index 7806819..7653479a 100644 --- a/gcc/c-decl.c +++ b/gcc/c-decl.c @@ -3765,7 +3765,10 @@ finish_decl (decl, init, asmspec_tree) else { if (asmspec) - DECL_ASSEMBLER_NAME (decl) = get_identifier (asmspec); + { + DECL_ASSEMBLER_NAME (decl) = get_identifier (asmspec); + DECL_C_HARD_REGISTER (decl) = 1; + } add_decl_stmt (decl); } diff --git a/gcc/c-semantics.c b/gcc/c-semantics.c index 8988680..d5150ba 100644 --- a/gcc/c-semantics.c +++ b/gcc/c-semantics.c @@ -313,9 +313,9 @@ emit_local_var (decl) /* Create RTL for this variable. */ if (!DECL_RTL (decl)) { - if (DECL_ASSEMBLER_NAME (decl) != DECL_NAME (decl)) - /* The user must have specified an assembler name for this - variable. Set that up now. */ + if (DECL_C_HARD_REGISTER (decl)) + /* The user specified an assembler name for this variable. + Set that up now. */ rest_of_decl_compilation (decl, IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (decl)), /*top_level=*/0, /*at_end=*/0); |