rs6000.c (rs6000_delegitimize_address): Check that TOC operand is a valid symbol...
authorDavid Edelsohn <dje@gcc.gnu.org>
Wed, 23 Jan 2013 16:24:54 +0000 (11:24 -0500)
committerDavid Edelsohn <dje@gcc.gnu.org>
Wed, 23 Jan 2013 16:24:54 +0000 (11:24 -0500)
        * config/rs6000/rs6000.c (rs6000_delegitimize_address): Check that
        TOC operand is a valid symbol ref in the constant pool.

From-SVN: r195409

gcc/ChangeLog
gcc/config/rs6000/rs6000.c

index a90ec6ef1fff8de29c126b8f0af0cbe259842aa2..b511b15e4dddb1f128e637e4da27ae8807f248c8 100644 (file)
@@ -1,4 +1,9 @@
-2013-01-23  Edgar E. Iglesias <edgar.iglesias@gmail.com>
+2013-01-23  David Edelsohn  <dje.gcc@gmail.com>
+
+       * config/rs6000/rs6000.c (rs6000_delegitimize_address): Check that
+       TOC operand is a valid symbol ref in the constant pool.
+
+2013-01-23  Edgar E. Iglesias  <edgar.iglesias@gmail.com>
 
        * gcc/config/microblaze/linux.h: Add TARGET_OS_CPP_BUILTINS
 
index 46bb0b437c362a73ed8375c215677d5552f72172..76d7f3da613aefcf8aa044031961da736a49f7f9 100644 (file)
@@ -5831,6 +5831,8 @@ rs6000_delegitimize_address (rtx orig_x)
       /* Do not associate thread-local symbols with the original
         constant pool symbol.  */
       if (TARGET_XCOFF
+         && GET_CODE (y) == SYMBOL_REF
+         && CONSTANT_POOL_ADDRESS_P (y)
          && SYMBOL_REF_TLS_MODEL (get_pool_constant (y)) >= TLS_MODEL_REAL)
        return orig_x;
 #endif