rl78.c (rl78_as_legitimate_address): Do not allow reg+addend addresses for the _far...
authorDJ Delorie <dj@redhat.com>
Fri, 26 Oct 2012 23:11:02 +0000 (19:11 -0400)
committerDJ Delorie <dj@gcc.gnu.org>
Fri, 26 Oct 2012 23:11:02 +0000 (19:11 -0400)
* config/rl78/rl78.c (rl78_as_legitimate_address): Do not allow
reg+addend addresses for the _far namespace.

From-SVN: r192866

gcc/ChangeLog
gcc/config/rl78/rl78.c

index 1668c54a9b448d7819b2210cc858504734ee6a4d..8b3c2b2670fe6e44d554d6a174669f63b187455f 100644 (file)
@@ -1,3 +1,8 @@
+2012-10-26  DJ Delorie  <dj@redhat.com>
+
+       * config/rl78/rl78.c (rl78_as_legitimate_address): Do not allow
+       reg+addend addresses for the _far namespace.
+
 2012-10-26  Segher Boessenkool  <segher@kernel.crashing.org>
 
        * config/rs6000/sync.md (ATOMIC): Correct DI condition.
index 990c1bb813922b9acc7626c15d76d9f53af2caa0..5e5050bca132445234bc75fdb2536ac0a99f53ca 100644 (file)
@@ -686,6 +686,13 @@ rl78_as_legitimate_address (enum machine_mode mode ATTRIBUTE_UNUSED, rtx x,
   if (! characterize_address (x, &base, &index, &addend))
     return false;
 
+  /* We can't extract the high/low portions of a PLUS address
+     involving a register during devirtualization, so make sure all
+     such __far addresses do not have addends.  This forces GCC to do
+     the sum separately.  */
+  if (addend && base && as == ADDR_SPACE_FAR)
+    return false;
+
   if (base && index)
     {
       int ir = REGNO (index);