public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] Fix rs6000_legitimize_address (PR target/35760)
@ 2008-10-11  2:47 Jakub Jelinek
  2008-10-11  2:52 ` David Edelsohn
  0 siblings, 1 reply; 2+ messages in thread
From: Jakub Jelinek @ 2008-10-11  2:47 UTC (permalink / raw)
  To: David Edelsohn; +Cc: gcc-patches

Hi!

rs6000_legitimize_address on ppc-darwin creates (e.g. on attached testcase)
LO_SUM that is rejected by rs6000_legitimate_address, so memory_address
fails one assertion.  rs6000_legitimate_address (in particular
legitimate_lo_sum_address_p) only allows GET_MODE_NUNITS (mode) == 1
LO_SUMs and rs6000_legitimize_address's ELF code checks that, but
not the MachO code.  I've tested with cross this patch fixes the ICE
and Andreas Tobler bootstrapped/regtested it on ppc-darwin (thanks):
http://gcc.gnu.org/ml/gcc-testresults/2008-10/msg00704.html

Ok for trunk?

2008-10-10  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.

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

--- gcc/config/rs6000/rs6000.c.jj	2008-10-07 16:17:02.000000000 +0200
+++ gcc/config/rs6000/rs6000.c	2008-10-09 16:10:53.000000000 +0200
@@ -3860,6 +3860,7 @@ rs6000_legitimize_address (rtx x, rtx ol
 	   && 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
--- gcc/testsuite/gcc.c-torture/compile/pr35760.c.jj	2008-09-30 10:18:57.740011359 +0200
+++ gcc/testsuite/gcc.c-torture/compile/pr35760.c	2008-10-09 16:16:59.000000000 +0200
@@ -0,0 +1,7 @@
+/* PR target/35760 */
+
+void
+foo (void)
+{
+  __complex__ float i = 0;
+}

	Jakub

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] Fix rs6000_legitimize_address (PR target/35760)
  2008-10-11  2:47 [PATCH] Fix rs6000_legitimize_address (PR target/35760) Jakub Jelinek
@ 2008-10-11  2:52 ` David Edelsohn
  0 siblings, 0 replies; 2+ messages in thread
From: David Edelsohn @ 2008-10-11  2:52 UTC (permalink / raw)
  To: Jakub Jelinek; +Cc: gcc-patches

On Fri, Oct 10, 2008 at 3:18 PM, Jakub Jelinek <jakub@redhat.com> wrote:

>        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.

Okay.

Thanks, David

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2008-10-11  2:45 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-10-11  2:47 [PATCH] Fix rs6000_legitimize_address (PR target/35760) Jakub Jelinek
2008-10-11  2:52 ` David Edelsohn

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).