[gcc(refs/users/meissner/heads/work013)] Fix thinko.

Michael Meissner meissner@gcc.gnu.org
Tue Sep 1 20:28:30 GMT 2020


https://gcc.gnu.org/g:00e43912a0ed0d830f4e48fec013ced6a18e8a76

commit 00e43912a0ed0d830f4e48fec013ced6a18e8a76
Author: Michael Meissner <meissner@linux.ibm.com>
Date:   Tue Sep 1 13:09:34 2020 -0400

    Fix thinko.
    
    gcc/
    2020-09-01  Michael Meissner  <meissner@linux.ibm.com>
    
            * config/rs6000/pcrel-opt.c (do_pcrel_opt_load): Fix thinko to
            allow ZERO_EXTEND, SIGN_EXTEND, and FLOAT_EXTEND.

Diff:
---
 gcc/config/rs6000/pcrel-opt.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/gcc/config/rs6000/pcrel-opt.c b/gcc/config/rs6000/pcrel-opt.c
index 73ee729c092..d28102321de 100644
--- a/gcc/config/rs6000/pcrel-opt.c
+++ b/gcc/config/rs6000/pcrel-opt.c
@@ -226,9 +226,6 @@ do_pcrel_opt_load (rtx_insn *addr_insn,		/* insn loading address.  */
     return;
 
   rtx mem = SET_SRC (load_set);
-  if (!MEM_P (mem))
-    return;
-
   machine_mode reg_mode = GET_MODE (reg);
   machine_mode mem_mode = GET_MODE (mem);
   rtx mem_inner = mem;
@@ -255,6 +252,9 @@ do_pcrel_opt_load (rtx_insn *addr_insn,		/* insn loading address.  */
       mem_mode = GET_MODE (mem_inner);
     }
 
+  if (!MEM_P (mem_inner))
+    return;
+
   /* If this is LFIWAX or similar instructions that are indexed only, we can't
      do the optimization.  */
   enum non_prefixed_form non_prefixed = reg_to_non_prefixed (reg, mem_mode);


More information about the Gcc-cvs mailing list