diff options
author | jakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4> | 2008-10-11 08:55:43 +0000 |
---|---|---|
committer | jakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4> | 2008-10-11 08:55:43 +0000 |
commit | 29ad7188582f2805094d993d189cbe676d84aa22 (patch) | |
tree | 7ee16b76a9eee4b027d70094c96fb31d27bea334 | |
parent | e9d51dd3ed5bbd43d7a6718e7822c495916c1413 (diff) | |
download | gcc-29ad7188582f2805094d993d189cbe676d84aa22.tar.gz |
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.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@141055 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r-- | gcc/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/config/rs6000/rs6000.c | 1 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/testsuite/gcc.c-torture/compile/pr35760.c | 7 | ||||
-rw-r--r-- | gcc/tree-switch-conversion.c | 27 |
5 files changed, 41 insertions, 5 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 2bc2367e71e..410dc97c7b3 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -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 diff --git a/gcc/config/rs6000/rs6000.c b/gcc/config/rs6000/rs6000.c index 9f48b611e6f..1218ea9b9b0 100644 --- a/gcc/config/rs6000/rs6000.c +++ b/gcc/config/rs6000/rs6000.c @@ -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 diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 92a0f4102fb..f7545fccaae 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -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 index 00000000000..9b972f6b1b7 --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/pr35760.c @@ -0,0 +1,7 @@ +/* PR target/35760 */ + +void +foo (void) +{ + __complex__ float i = 0; +} diff --git a/gcc/tree-switch-conversion.c b/gcc/tree-switch-conversion.c index e9757454f21..798cf161569 100644 --- a/gcc/tree-switch-conversion.c +++ b/gcc/tree-switch-conversion.c @@ -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; + } } } } |