From 3f13154553f8546ac3b2154440bca0cf556d57a7 Mon Sep 17 00:00:00 2001 From: Alexander Monakov Date: Wed, 23 May 2018 18:01:28 +0300 Subject: [PATCH] df-scan: remove ad-hoc handling of global regs in asms PR rtl-optimization/79985 * df-scan.c (df_insn_refs_collect): Remove special case for global registers and asm statements. testsuite/ * gcc.dg/pr79985.c: New testcase. From-SVN: r260613 --- gcc/ChangeLog | 6 ++++++ gcc/df-scan.c | 11 ----------- gcc/testsuite/ChangeLog | 4 ++++ gcc/testsuite/gcc.dg/pr79985.c | 12 ++++++++++++ 4 files changed, 22 insertions(+), 11 deletions(-) create mode 100644 gcc/testsuite/gcc.dg/pr79985.c diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 5eb34806791..270c979e84e 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2018-05-23 Alexander Monakov + + PR rtl-optimization/79985 + * df-scan.c (df_insn_refs_collect): Remove special case for + global registers and asm statements. + 2018-05-23 Alexander Monakov * extend.texi (Global Register Variables): Rewrite the bullet list. diff --git a/gcc/df-scan.c b/gcc/df-scan.c index 95e1e0df2d5..cbb08fc36ae 100644 --- a/gcc/df-scan.c +++ b/gcc/df-scan.c @@ -3207,17 +3207,6 @@ df_insn_refs_collect (struct df_collection_rec *collection_rec, if (CALL_P (insn_info->insn)) df_get_call_refs (collection_rec, bb, insn_info, flags); - if (asm_noperands (PATTERN (insn_info->insn)) >= 0) - for (unsigned i = 0; i < FIRST_PSEUDO_REGISTER; i++) - if (global_regs[i]) - { - /* As with calls, asm statements reference all global regs. */ - df_ref_record (DF_REF_BASE, collection_rec, regno_reg_rtx[i], - NULL, bb, insn_info, DF_REF_REG_USE, flags); - df_ref_record (DF_REF_BASE, collection_rec, regno_reg_rtx[i], - NULL, bb, insn_info, DF_REF_REG_DEF, flags); - } - /* Record other defs. These should be mostly for DF_REF_REGULAR, so that a qsort on the defs is unnecessary in most cases. */ df_defs_record (collection_rec, diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index b3cf4b1fd95..5b16f44d8ff 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,7 @@ +2018-05-23 Alexander Monakov + + * gcc.dg/pr79985.c: New testcase. + 2018-05-23 Richard Biener * gcc.dg/tree-ssa/ssa-fre-66.c: New testcase. diff --git a/gcc/testsuite/gcc.dg/pr79985.c b/gcc/testsuite/gcc.dg/pr79985.c new file mode 100644 index 00000000000..7b5a5b27213 --- /dev/null +++ b/gcc/testsuite/gcc.dg/pr79985.c @@ -0,0 +1,12 @@ +/* PR rtl-optimization/79985 */ +/* { dg-do compile { target powerpc*-*-* ia64-*-* i?86-*-* x86_64-*-* } } */ +/* { dg-options "-O3 -fschedule-insns -fselective-scheduling" } */ + +long a; +int b; +void +c () +{ + __asm("" : "=r"(a) : "0"(c)); + __asm("" : "=r"(b)); +} -- 2.30.2