diff options
author | Kyrylo Tkachov <kyrylo.tkachov@arm.com> | 2016-10-21 07:55:30 +0000 |
---|---|---|
committer | Kyrylo Tkachov <ktkachov@gcc.gnu.org> | 2016-10-21 07:55:30 +0000 |
commit | 0d47cee6c4d1c2d1b3a0a4c22becde465660d6f1 (patch) | |
tree | d995170944367b2434e3ebb81e4855452cf1ba8a /gcc/ree.c | |
parent | a20d03c88261b7d475db7c410c1018df326c67af (diff) | |
download | gcc-0d47cee6c4d1c2d1b3a0a4c22becde465660d6f1.zip gcc-0d47cee6c4d1c2d1b3a0a4c22becde465660d6f1.tar.gz gcc-0d47cee6c4d1c2d1b3a0a4c22becde465660d6f1.tar.bz2 |
[ree] PR rtl-optimization/78038: Handle global register dataflow definitions in ree
PR rtl-optimization/78038
* ree.c (get_defs): Return NULL if a defining insn for REG cannot
be deduced to set REG through the RTL structure.
(make_defs_and_copies_lists): Return false on a failing get_defs call.
* gcc.target/aarch64/pr78038.c: New test.
From-SVN: r241395
Diffstat (limited to 'gcc/ree.c')
-rw-r--r-- | gcc/ree.c | 10 |
1 files changed, 9 insertions, 1 deletions
@@ -482,6 +482,14 @@ get_defs (rtx_insn *insn, rtx reg, vec<rtx_insn *> *dest) return NULL; if (DF_REF_INSN_INFO (ref_link->ref) == NULL) return NULL; + /* As global regs are assumed to be defined at each function call + dataflow can report a call_insn as being a definition of REG. + But we can't do anything with that in this pass so proceed only + if the instruction really sets REG in a way that can be deduced + from the RTL structure. */ + if (global_regs[REGNO (reg)] + && !set_of (reg, DF_REF_INSN (ref_link->ref))) + return NULL; } if (dest) @@ -580,7 +588,7 @@ make_defs_and_copies_lists (rtx_insn *extend_insn, const_rtx set_pat, /* Initialize the work list. */ if (!get_defs (extend_insn, src_reg, &state->work_list)) - gcc_unreachable (); + return false; is_insn_visited = XCNEWVEC (bool, max_insn_uid); |