dwarf2out.c (loc_checksum): Call hash_loc_operands for a deterministic hash.

gcc/
	* dwarf2out.c (loc_checksum): Call hash_loc_operands for a
	deterministic hash.
	(loc_checksum_ordered): Likewise.
	(hash_loc_operands): Remove inline keyword.

From-SVN: r200626
This commit is contained in:
Cary Coutant 2013-07-02 22:18:39 +00:00 committed by Cary Coutant
parent 45165729bb
commit 4b04355371
2 changed files with 18 additions and 5 deletions

View File

@ -1,3 +1,10 @@
2013-07-02 Cary Coutant <ccoutant@google.com>
* dwarf2out.c (loc_checksum): Call hash_loc_operands for a
deterministic hash.
(loc_checksum_ordered): Likewise.
(hash_loc_operands): Remove inline keyword.
2013-07-02 Jakub Jelinek <jakub@redhat.com> 2013-07-02 Jakub Jelinek <jakub@redhat.com>
PR tree-optimization/57741 PR tree-optimization/57741

View File

@ -3214,6 +3214,8 @@ static void gen_scheduled_generic_parms_dies (void);
static const char *comp_dir_string (void); static const char *comp_dir_string (void);
static hashval_t hash_loc_operands (dw_loc_descr_ref, hashval_t);
/* enum for tracking thread-local variables whose address is really an offset /* enum for tracking thread-local variables whose address is really an offset
relative to the TLS pointer, which will need link-time relocation, but will relative to the TLS pointer, which will need link-time relocation, but will
not need relocation by the DWARF consumer. */ not need relocation by the DWARF consumer. */
@ -5437,11 +5439,12 @@ static inline void
loc_checksum (dw_loc_descr_ref loc, struct md5_ctx *ctx) loc_checksum (dw_loc_descr_ref loc, struct md5_ctx *ctx)
{ {
int tem; int tem;
hashval_t hash = 0;
tem = (loc->dtprel << 8) | ((unsigned int) loc->dw_loc_opc); tem = (loc->dtprel << 8) | ((unsigned int) loc->dw_loc_opc);
CHECKSUM (tem); CHECKSUM (tem);
CHECKSUM (loc->dw_loc_oprnd1); hash = hash_loc_operands (loc, hash);
CHECKSUM (loc->dw_loc_oprnd2); CHECKSUM (hash);
} }
/* Calculate the checksum of an attribute. */ /* Calculate the checksum of an attribute. */
@ -5643,9 +5646,12 @@ loc_checksum_ordered (dw_loc_descr_ref loc, struct md5_ctx *ctx)
/* Otherwise, just checksum the raw location expression. */ /* Otherwise, just checksum the raw location expression. */
while (loc != NULL) while (loc != NULL)
{ {
hashval_t hash = 0;
CHECKSUM_ULEB128 (loc->dtprel);
CHECKSUM_ULEB128 (loc->dw_loc_opc); CHECKSUM_ULEB128 (loc->dw_loc_opc);
CHECKSUM (loc->dw_loc_oprnd1); hash = hash_loc_operands (loc, hash);
CHECKSUM (loc->dw_loc_oprnd2); CHECKSUM (hash);
loc = loc->dw_loc_next; loc = loc->dw_loc_next;
} }
} }
@ -23107,7 +23113,7 @@ resolve_addr (dw_die_ref die)
/* Iteratively hash operands of LOC opcode. */ /* Iteratively hash operands of LOC opcode. */
static inline hashval_t static hashval_t
hash_loc_operands (dw_loc_descr_ref loc, hashval_t hash) hash_loc_operands (dw_loc_descr_ref loc, hashval_t hash)
{ {
dw_val_ref val1 = &loc->dw_loc_oprnd1; dw_val_ref val1 = &loc->dw_loc_oprnd1;