[gcc(refs/vendors/ARM/heads/arm-perf-staging)] [gcn] Fix build with RTL checking [PR94248]

Tamar Christina tnfchris@gcc.gnu.org
Fri Jul 17 15:03:29 GMT 2020


https://gcc.gnu.org/g:ccf93cd0b21e9c0ff0a1d4ace59899fca25ac157

commit ccf93cd0b21e9c0ff0a1d4ace59899fca25ac157
Author: Jakub Jelinek <jakub@redhat.com>
Date:   Sat Mar 21 14:39:56 2020 +0000

    [gcn] Fix build with RTL checking [PR94248]
    
    Building (for offloading) a '--target=amdgcn-amdhsa' GCC with
    '--enable-checking=yes,extra,rtl' fails:
    
        during RTL pass: split2
        [...]/source-gcc/libgcc/libgcc2.c: In function '__absvdi2':
        [...]/source-gcc/libgcc/libgcc2.c:271:1: internal compiler error: RTL check: expected code 'reg', have 'const_int' in rhs_regno, at rtl.h:1923
          271 | }
              | ^
        0x565847 ???
                [...]/source-gcc/gcc/rtl.c:881
        0x59a8a4 ???
                [...]/source-gcc/gcc/rtl.h:1923
        0x12e3a5c ???
                [...]/source-gcc/gcc/config/gcn/gcn.md:631
        [...]
        Makefile:501: recipe for target '_absvdi2.o' failed
        make[4]: *** [_absvdi2.o] Error 1
        make[4]: Leaving directory '[...]/build-gcc-offload-amdgcn-amdhsa/amdgcn-amdhsa/gfx900/libgcc'
    
            gcc/
            PR target/94248
            * config/gcn/gcn.md (*mov<mode>_insn): Use
            'reg_overlap_mentioned_p' to check for overlap.
    
    Tested-by: Thomas Schwinge <thomas@codesourcery.com>

Diff:
---
 gcc/ChangeLog         | 4 ++++
 gcc/config/gcn/gcn.md | 2 +-
 2 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 5541d9c62d9..3321e883970 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,5 +1,9 @@
 2020-04-29  Jakub Jelinek  <jakub@redhat.com>
 
+	PR target/94248
+	* config/gcn/gcn.md (*mov<mode>_insn): Use
+	'reg_overlap_mentioned_p' to check for overlap.
+
 	PR target/94706
 	* config/ia64/ia64.c (hfa_element_mode): Use DECL_FIELD_ABI_IGNORED
 	instead of cxx17_empty_base_field_p.
diff --git a/gcc/config/gcn/gcn.md b/gcc/config/gcn/gcn.md
index 8f5937781b2..8cfb3a85d25 100644
--- a/gcc/config/gcn/gcn.md
+++ b/gcc/config/gcn/gcn.md
@@ -629,7 +629,7 @@
     rtx outhi = gen_highpart_mode (SImode, <MODE>mode, operands[0]);
 
     /* Ensure that overlapping registers aren't corrupted.  */
-    if (REGNO (outlo) == REGNO (inhi))
+    if (reg_overlap_mentioned_p (outlo, inhi))
       {
 	operands[0] = outhi;
 	operands[1] = inhi;


More information about the Gcc-cvs mailing list