]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR target/35760 (ICE with complex types and -static on PPC darwin)
authorJakub Jelinek <jakub@redhat.com>
Sat, 11 Oct 2008 08:55:43 +0000 (10:55 +0200)
committerJakub Jelinek <jakub@gcc.gnu.org>
Sat, 11 Oct 2008 08:55:43 +0000 (10:55 +0200)
PR target/35760
* config/rs6000/rs6000.c (rs6000_legitimize_address): Only create
LO_SUM on Darwin if mode has just one unit.

* gcc.c-torture/compile/pr35760.c: New test.

From-SVN: r141055

gcc/ChangeLog
gcc/config/rs6000/rs6000.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.c-torture/compile/pr35760.c [new file with mode: 0644]
gcc/tree-switch-conversion.c

index 2bc2367e71e0a323bdd65b85f68b714ac50ec3ef..410dc97c7b3ec2f23f7d69a0c7b6fdb18558803b 100644 (file)
@@ -1,3 +1,9 @@
+2008-10-11  Jakub Jelinek  <jakub@redhat.com>
+
+       PR target/35760
+       * config/rs6000/rs6000.c (rs6000_legitimize_address): Only create
+       LO_SUM on Darwin if mode has just one unit.
+
 2008-10-10  H.J. Lu  <hongjiu.lu@intel.com>
 
        PR debug/37002
index 9f48b611e6f88ca5748840d6a19a7d912b393723..1218ea9b9b0d92d768191227a7ca0c6e8c36e768 100644 (file)
@@ -3860,6 +3860,7 @@ rs6000_legitimize_address (rtx x, rtx oldx ATTRIBUTE_UNUSED,
           && GET_CODE (x) != CONST_INT
           && GET_CODE (x) != CONST_DOUBLE
           && CONSTANT_P (x)
+          && GET_MODE_NUNITS (mode) == 1
           && ((TARGET_HARD_FLOAT && TARGET_FPRS && TARGET_DOUBLE_FLOAT)
               || (mode != DFmode && mode != DDmode))
           && mode != DImode
index 92a0f4102fb74a249485886ea67f510364b2647e..f7545fccaaeff06a5e1e824604f234ea8d0913c5 100644 (file)
@@ -1,3 +1,8 @@
+2008-10-11  Jakub Jelinek  <jakub@redhat.com>
+
+       PR target/35760
+       * gcc.c-torture/compile/pr35760.c: New test.
+
 2008-10-10  Jakub Jelinek  <jakub@redhat.com>
 
        PR c++/37146
diff --git a/gcc/testsuite/gcc.c-torture/compile/pr35760.c b/gcc/testsuite/gcc.c-torture/compile/pr35760.c
new file mode 100644 (file)
index 0000000..9b972f6
--- /dev/null
@@ -0,0 +1,7 @@
+/* PR target/35760 */
+
+void
+foo (void)
+{
+  __complex__ float i = 0;
+}
index e9757454f21923c1197d5098b2e9d841949c396c..798cf161569460d8713feb2f6ac9d6be4e623b34 100644 (file)
@@ -296,12 +296,29 @@ check_final_bb (void)
        {
          basic_block bb = gimple_phi_arg_edge (phi, i)->src;
 
-         if ((bb == info.switch_bb
-              || (single_pred_p (bb) && single_pred (bb) == info.switch_bb))
-             && !is_gimple_ip_invariant (gimple_phi_arg_def (phi, i)))
+         if (bb == info.switch_bb
+             || (single_pred_p (bb) && single_pred (bb) == info.switch_bb))
            {
-             info.reason = "   Non-invariant value from a case\n";
-             return false; /* Non-invariant argument.  */
+             tree reloc, val;
+
+             val = gimple_phi_arg_def (phi, i);
+             if (!is_gimple_ip_invariant (val))
+               {
+                 info.reason = "   Non-invariant value from a case\n";
+                 return false; /* Non-invariant argument.  */
+               }
+             reloc = initializer_constant_valid_p (val, TREE_TYPE (val));
+             if ((flag_pic && reloc != null_pointer_node)
+                 || (!flag_pic && reloc == NULL_TREE))
+               {
+                 if (reloc)
+                   info.reason
+                     = "   Value from a case would need runtime relocations\n";
+                 else
+                   info.reason
+                     = "   Value from a case is not a valid initializer\n";
+                 return false;
+               }
            }
        }
     }