From: Julian Brown Date: Wed, 20 Nov 2019 17:58:30 +0000 (+0000) Subject: AMD GCN symbol output with null cfun X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=9200b53af2db1ad3cf2059a40f4ca8daf90be6f0;p=gcc.git AMD GCN symbol output with null cfun gcc/ * config/gcn/gcn.c (gcn_asm_output_symbol_ref): Handle null cfun. Reviewed-by: Andrew Stubbs From-SVN: r278518 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 0f526b1a9f7..1d9001510ce 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,7 @@ +2019-11-20 Julian Brown + + * config/gcn/gcn.c (gcn_asm_output_symbol_ref): Handle null cfun. + 2019-11-20 Jan Hubicka * ipa-fnsummary.c (ipa_fn_summary::account_size_time): Add CALL diff --git a/gcc/config/gcn/gcn.c b/gcc/config/gcn/gcn.c index 4401896d441..26c1067e52a 100644 --- a/gcc/config/gcn/gcn.c +++ b/gcc/config/gcn/gcn.c @@ -5215,7 +5215,8 @@ void gcn_asm_output_symbol_ref (FILE *file, rtx x) { tree decl; - if ((decl = SYMBOL_REF_DECL (x)) != 0 + if (cfun + && (decl = SYMBOL_REF_DECL (x)) != 0 && TREE_CODE (decl) == VAR_DECL && AS_LDS_P (TYPE_ADDR_SPACE (TREE_TYPE (decl)))) { @@ -5230,7 +5231,8 @@ gcn_asm_output_symbol_ref (FILE *file, rtx x) { assemble_name (file, XSTR (x, 0)); /* FIXME: See above -- this condition is unreachable. */ - if ((decl = SYMBOL_REF_DECL (x)) != 0 + if (cfun + && (decl = SYMBOL_REF_DECL (x)) != 0 && TREE_CODE (decl) == VAR_DECL && AS_LDS_P (TYPE_ADDR_SPACE (TREE_TYPE (decl)))) fputs ("@abs32", file);