]> gcc.gnu.org Git - gcc.git/commitdiff
re PR target/45800 ([M32C] compile error on increment volatile long var)
authorDJ Delorie <dj@redhat.com>
Tue, 28 Sep 2010 22:01:54 +0000 (18:01 -0400)
committerDJ Delorie <dj@gcc.gnu.org>
Tue, 28 Sep 2010 22:01:54 +0000 (18:01 -0400)
PR target/45800
* config/m32c/m32c.c (m32c_subreg): Force adjustment of subregs of
volatile MEMs.

From-SVN: r164705

gcc/ChangeLog
gcc/config/m32c/m32c.c

index 2aded9728623f9b5ff0efc82ad18b4fadd05365a..0fe8fbb20a7e53d4c973a32abb516f5cce2a07b1 100644 (file)
@@ -1,3 +1,9 @@
+2010-09-28  DJ Delorie  <dj@redhat.com>
+
+       PR target/45800
+       * config/m32c/m32c.c (m32c_subreg): Force adjustment of subregs of
+       volatile MEMs.
+
 2010-09-28  Iain Sandoe  <iains@gcc.gnu.org>
 
        * c-parser.c (c_parser_declaration_or_fndef): Diagnose incorrect prefix
index 066d1a8488603807b2af7b35e40771bc721980de..d62b4f2321cc60774a6ea1c6889151744c82225d 100644 (file)
@@ -3317,7 +3317,19 @@ m32c_subreg (enum machine_mode outer,
     return gen_rtx_MEM (outer, XEXP (XEXP (x, 0), 0));
 
   if (GET_CODE (x) != REG)
-    return simplify_gen_subreg (outer, x, inner, byte);
+    {
+      rtx r = simplify_gen_subreg (outer, x, inner, byte);
+      if (GET_CODE (r) == SUBREG
+         && GET_CODE (x) == MEM
+         && MEM_VOLATILE_P (x))
+       {
+         /* Volatile MEMs don't get simplified, but we need them to
+            be.  We are little endian, so the subreg byte is the
+            offset.  */
+         r = adjust_address (x, outer, byte);
+       }
+      return r;
+    }
 
   r = REGNO (x);
   if (r >= FIRST_PSEUDO_REGISTER || r == AP_REGNO)
This page took 0.096804 seconds and 5 git commands to generate.