https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113010

Greg McGary <gkm at rivosinc dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |UNCONFIRMED
         Resolution|DUPLICATE                   |---

--- Comment #3 from Greg McGary <gkm at rivosinc dot com> ---
This fixes it, though I would like second look from someone more familiar with
the combiner:

diff --git a/gcc/combine.cc b/gcc/combine.cc
index 812553c091e..cd159db2a33 100644
--- a/gcc/combine.cc
+++ b/gcc/combine.cc
@@ -7208,6 +7208,10 @@ expand_compound_operation (rtx x)
       if (len == 0)
        return x;

+      /* Sign-extending loads can never be simplified at compile time.  */
+      if (MEM_P (XEXP (x, 0)) && load_extend_op (inner_mode) == SIGN_EXTEND)
+ return x;
+
       break;

     case ZERO_EXTRACT:

Reply via email to