From: rth Date: Fri, 28 Apr 2000 20:25:38 +0000 (+0000) Subject: * varasm.c (record_constant_1): Record the CODE_LABEL when X-Git-Url: http://git.sourceforge.jp/view?p=pf3gnuchains%2Fgcc-fork.git;a=commitdiff_plain;h=9fbf5c73c143515bc9f563cb80075197d8ed10bb * varasm.c (record_constant_1): Record the CODE_LABEL when taking the address of a LABEL_REF. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@33517 138bc75d-0d04-0410-961f-82ee72b054a4 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 7db2bc046ee..3b4e73dcd99 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,4 +1,9 @@ 2000-04-28 Richard Henderson + + * varasm.c (record_constant_1): Record the CODE_LABEL when + taking the address of a LABEL_REF. + +2000-04-28 Richard Henderson Jan Hubicka * calls.c (combine_pending_stack_adjustment_and_call): Return the diff --git a/gcc/varasm.c b/gcc/varasm.c index 5224284cb26..0c682206aa6 100644 --- a/gcc/varasm.c +++ b/gcc/varasm.c @@ -2867,9 +2867,24 @@ record_constant_1 (exp) /* Record the offset. */ obstack_grow (&permanent_obstack, (char *) &value.offset, sizeof value.offset); - /* Record the symbol name. */ - obstack_grow (&permanent_obstack, XSTR (value.base, 0), - strlen (XSTR (value.base, 0)) + 1); + + switch (GET_CODE (value.base)) + { + case SYMBOL_REF: + /* Record the symbol name. */ + obstack_grow (&permanent_obstack, XSTR (value.base, 0), + strlen (XSTR (value.base, 0)) + 1); + break; + case LABEL_REF: + /* Record the address of the CODE_LABEL. It may not have + been emitted yet, so it's UID may be zero. But pointer + identity is good enough. */ + obstack_grow (&permanent_obstack, &XEXP (value.base, 0), + sizeof (rtx)); + break; + default: + abort (); + } } return;