public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] Restore backwards compatibility of ppc inline asm with asm dialects (PR target/56256)
@ 2013-02-09  8:21 Jakub Jelinek
  2013-02-09  9:26 ` David Edelsohn
  0 siblings, 1 reply; 2+ messages in thread
From: Jakub Jelinek @ 2013-02-09  8:21 UTC (permalink / raw)
  To: David Edelsohn; +Cc: gcc-patches

Hi!

When old mnemonics support has been dropped, the ASSEMBLER_DIALECT
macro has been removed also.  This has unfortunate effect that
projects that used {|} in inline asm for ppc no longer compile, as the
{, | and } characters are now passed through to the assembler.

This patch defines ASSEMBLER_DIALECT again to fix this.

Bootstrapped/regtested on powerpc-linux and powerpc64-linux, ok for trunk?

2013-02-09  Jakub Jelinek  <jakub@redhat.com>

	PR target/56256
	* config/rs6000/rs6000.h (ASSEMBLER_DIALECT): Define.

	* gcc.target/powerpc/pr56256.c: New test.

--- gcc/config/rs6000/rs6000.h.jj	2013-01-11 09:03:12.000000000 +0100
+++ gcc/config/rs6000/rs6000.h	2013-02-08 16:46:35.988977363 +0100
@@ -356,6 +356,12 @@ extern const char *host_detect_local_cpu
 #define PROCESSOR_DEFAULT   PROCESSOR_PPC603
 #define PROCESSOR_DEFAULT64 PROCESSOR_RS64A
 
+/* Specify the dialect of assembler to use.  Only new mnemonics are supported
+   starting with GCC 4.8, i.e. just one dialect, but for backwards
+   compatibility with older inline asm ASSEMBLER_DIALECT needs to be
+   defined.  */
+#define ASSEMBLER_DIALECT 1
+
 /* Debug support */
 #define MASK_DEBUG_STACK	0x01	/* debug stack applications */
 #define	MASK_DEBUG_ARG		0x02	/* debug argument handling */
--- gcc/testsuite/gcc.target/powerpc/pr56256.c.jj	2013-02-08 17:00:11.096171281 +0100
+++ gcc/testsuite/gcc.target/powerpc/pr56256.c	2013-02-08 17:09:05.448004295 +0100
@@ -0,0 +1,11 @@
+/* PR target/56256 */
+/* { dg-do assemble } */
+/* { dg-options "-O2" } */
+
+int
+foo (void)
+{
+  int a;
+  __asm__ ("{lil|li} %0,%1" : "=r" (a) : "I" (26));
+  return a;
+}

	Jakub

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

* Re: [PATCH] Restore backwards compatibility of ppc inline asm with asm dialects (PR target/56256)
  2013-02-09  8:21 [PATCH] Restore backwards compatibility of ppc inline asm with asm dialects (PR target/56256) Jakub Jelinek
@ 2013-02-09  9:26 ` David Edelsohn
  0 siblings, 0 replies; 2+ messages in thread
From: David Edelsohn @ 2013-02-09  9:26 UTC (permalink / raw)
  To: Jakub Jelinek; +Cc: gcc-patches

On Sat, Feb 9, 2013 at 3:21 AM, Jakub Jelinek <jakub@redhat.com> wrote:
> Hi!
>
> When old mnemonics support has been dropped, the ASSEMBLER_DIALECT
> macro has been removed also.  This has unfortunate effect that
> projects that used {|} in inline asm for ppc no longer compile, as the
> {, | and } characters are now passed through to the assembler.
>
> This patch defines ASSEMBLER_DIALECT again to fix this.
>
> Bootstrapped/regtested on powerpc-linux and powerpc64-linux, ok for trunk?
>
> 2013-02-09  Jakub Jelinek  <jakub@redhat.com>
>
>         PR target/56256
>         * config/rs6000/rs6000.h (ASSEMBLER_DIALECT): Define.
>
>         * gcc.target/powerpc/pr56256.c: New test.

Okay.

Thanks, David

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

end of thread, other threads:[~2013-02-09  9:26 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-02-09  8:21 [PATCH] Restore backwards compatibility of ppc inline asm with asm dialects (PR target/56256) Jakub Jelinek
2013-02-09  9:26 ` 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).