public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* Patch to fix PR92176
@ 2019-12-06 19:35 Vladimir Makarov
  0 siblings, 0 replies; only message in thread
From: Vladimir Makarov @ 2019-12-06 19:35 UTC (permalink / raw)
  To: gcc-patches

[-- Attachment #1: Type: text/plain, Size: 153 bytes --]

The following patch fixes

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

The patch was tested on i686, x86-64, and ppc64.

Committed as r279061.



[-- Attachment #2: pr92176.patch --]
[-- Type: text/x-patch, Size: 2478 bytes --]

Index: ChangeLog
===================================================================
--- ChangeLog	(revision 279060)
+++ ChangeLog	(working copy)
@@ -1,3 +1,10 @@
+2019-12-06  Andreas Krebbel  <krebbel@linux.ibm.com>
+	    Vladimir Makarov  <vmakarov@redhat.com>
+
+	PR rtl-optimization/92176
+	* lra.c (simplify_subreg_regno): Don't permit unconditional
+	changing mode for LRA too.
+
 2019-12-06  Richard Sandiford  <richard.sandiford@arm.com>
 
 	* target.h (TCTX_ALLOCATION, TCTX_DEALLOCATION, TCTX_EXCEPTIONS)
Index: rtlanal.c
===================================================================
--- rtlanal.c	(revision 279060)
+++ rtlanal.c	(working copy)
@@ -3951,9 +3951,7 @@ simplify_subreg_regno (unsigned int xreg
   /* Give the backend a chance to disallow the mode change.  */
   if (GET_MODE_CLASS (xmode) != MODE_COMPLEX_INT
       && GET_MODE_CLASS (xmode) != MODE_COMPLEX_FLOAT
-      && !REG_CAN_CHANGE_MODE_P (xregno, xmode, ymode)
-      /* We can use mode change in LRA for some transformations.  */
-      && ! lra_in_progress)
+      && !REG_CAN_CHANGE_MODE_P (xregno, xmode, ymode))
     return -1;
 
   /* We shouldn't simplify stack-related registers.  */
Index: testsuite/ChangeLog
===================================================================
--- testsuite/ChangeLog	(revision 279060)
+++ testsuite/ChangeLog	(working copy)
@@ -1,3 +1,9 @@
+2019-12-06  Andreas Krebbel  <krebbel@linux.ibm.com>
+	    Vladimir Makarov  <vmakarov@redhat.com>
+
+	PR rtl-optimization/92176
+	* gcc.target/s390/pr92176.c: New test.
+
 2019-12-06  Martin Sebor  <msebor@redhat.com>
 
 	* gcc.dg/Wstringop-overflow-23.c: Use the correct argument type.
Index: testsuite/gcc.target/s390/pr92176.c
===================================================================
--- testsuite/gcc.target/s390/pr92176.c	(nonexistent)
+++ testsuite/gcc.target/s390/pr92176.c	(working copy)
@@ -0,0 +1,33 @@
+/* { dg-do compile } */
+/* { dg-options "-O3 -march=z13 -mzarch" } */
+
+int a = 5, b, c, d, g, h, k, l, m, o;
+static int e[7];
+int *volatile i = &d;
+long long j;
+
+short p(int f, int dummy) {
+  k = 0 != (*e = m);
+  j = 0;
+  for (; j < 59; j = j + 1)
+    *i |= b;
+  g = 1;
+  for (; g <= 4; g++) {
+    o = 0;
+    for (; o <= 4; o++)
+      i = (int * volatile)(long)l;
+  }
+  return 42;
+}
+
+void
+q() {
+  char *n = (char*)&b;
+
+  (*n = a) == p(e[6], c);
+  for (; h;)
+    for (;;)
+      ;
+}
+
+/* { dg-final { scan-assembler-not {(?n)^\tvsteb\t.+,0$} } } */

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2019-12-06 19:35 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-12-06 19:35 Patch to fix PR92176 Vladimir Makarov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).