public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] Fix bootstrap with older and non-GCC host compilers
@ 2016-01-19 14:19 Richard Biener
  2016-01-19 14:33 ` Jakub Jelinek
  0 siblings, 1 reply; 3+ messages in thread
From: Richard Biener @ 2016-01-19 14:19 UTC (permalink / raw)
  To: gcc-patches; +Cc: Martin Jambor


It also seems we're wrongly using values defined for the host while
looking at GIMPLE IL for the target.

Bootstrap / regtest running on x86_64-unknown-linux-gnu.

Ok?

Richard.

2016-01-19  Richard Biener  <rguenther@suse.de>

	* hsa-gen.c (get_memory_order_name): Use MEMMODEL_ constants
	and name.
	(get_memory_order): Likewise.

Index: gcc/hsa-gen.c
===================================================================
--- gcc/hsa-gen.c	(revision 232561)
+++ gcc/hsa-gen.c	(working copy)
@@ -4417,18 +4417,18 @@ get_memory_order_name (unsigned memmodel
 {
   switch (memmodel)
     {
-    case __ATOMIC_RELAXED:
-      return "__ATOMIC_RELAXED";
-    case __ATOMIC_CONSUME:
-      return "__ATOMIC_CONSUME";
-    case __ATOMIC_ACQUIRE:
-      return "__ATOMIC_ACQUIRE";
-    case __ATOMIC_RELEASE:
-      return "__ATOMIC_RELEASE";
-    case __ATOMIC_ACQ_REL:
-      return "__ATOMIC_ACQ_REL";
-    case __ATOMIC_SEQ_CST:
-      return "__ATOMIC_SEQ_CST";
+    case MEMMODEL_RELAXED:
+      return "MEMMODEL_RELAXED";
+    case MEMMODEL_CONSUME:
+      return "MEMMODEL_CONSUME";
+    case MEMMODEL_ACQUIRE:
+      return "MEMMODEL_ACQUIRE";
+    case MEMMODEL_RELEASE:
+      return "MEMMODEL_RELEASE";
+    case MEMMODEL_ACQ_REL:
+      return "MEMMODEL_ACQ_REL";
+    case MEMMODEL_SEQ_CST:
+      return "MEMMODEL_SEQ_CST";
     default:
       return NULL;
     }
@@ -4442,13 +4442,13 @@ get_memory_order (unsigned memmodel, loc
 {
   switch (memmodel)
     {
-    case __ATOMIC_RELAXED:
+    case MEMMODEL_RELAXED:
       return BRIG_MEMORY_ORDER_RELAXED;
-    case __ATOMIC_ACQUIRE:
+    case MEMMODEL_ACQUIRE:
       return BRIG_MEMORY_ORDER_SC_ACQUIRE;
-    case __ATOMIC_RELEASE:
+    case MEMMODEL_RELEASE:
       return BRIG_MEMORY_ORDER_SC_RELEASE;
-    case __ATOMIC_ACQ_REL:
+    case MEMMODEL_ACQ_REL:
       return BRIG_MEMORY_ORDER_SC_ACQUIRE_RELEASE;
     default:
       HSA_SORRY_ATV (location,

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

* Re: [PATCH] Fix bootstrap with older and non-GCC host compilers
  2016-01-19 14:19 [PATCH] Fix bootstrap with older and non-GCC host compilers Richard Biener
@ 2016-01-19 14:33 ` Jakub Jelinek
  2016-01-19 15:08   ` Richard Biener
  0 siblings, 1 reply; 3+ messages in thread
From: Jakub Jelinek @ 2016-01-19 14:33 UTC (permalink / raw)
  To: Richard Biener; +Cc: gcc-patches, Martin Jambor

On Tue, Jan 19, 2016 at 03:19:17PM +0100, Richard Biener wrote:
> 
> It also seems we're wrongly using values defined for the host while
> looking at GIMPLE IL for the target.
> 
> Bootstrap / regtest running on x86_64-unknown-linux-gnu.
> 
> Ok?
> 
> Richard.
> 
> 2016-01-19  Richard Biener  <rguenther@suse.de>
> 
> 	* hsa-gen.c (get_memory_order_name): Use MEMMODEL_ constants
> 	and name.
> 	(get_memory_order): Likewise.
> 
> Index: gcc/hsa-gen.c
> ===================================================================
> --- gcc/hsa-gen.c	(revision 232561)
> +++ gcc/hsa-gen.c	(working copy)
> @@ -4417,18 +4417,18 @@ get_memory_order_name (unsigned memmodel
>  {
>    switch (memmodel)
>      {
> -    case __ATOMIC_RELAXED:
> -      return "__ATOMIC_RELAXED";
> -    case __ATOMIC_CONSUME:
> -      return "__ATOMIC_CONSUME";
> -    case __ATOMIC_ACQUIRE:
> -      return "__ATOMIC_ACQUIRE";
> -    case __ATOMIC_RELEASE:
> -      return "__ATOMIC_RELEASE";
> -    case __ATOMIC_ACQ_REL:
> -      return "__ATOMIC_ACQ_REL";
> -    case __ATOMIC_SEQ_CST:
> -      return "__ATOMIC_SEQ_CST";
> +    case MEMMODEL_RELAXED:
> +      return "MEMMODEL_RELAXED";
> +    case MEMMODEL_CONSUME:
> +      return "MEMMODEL_CONSUME";
> +    case MEMMODEL_ACQUIRE:
> +      return "MEMMODEL_ACQUIRE";
> +    case MEMMODEL_RELEASE:
> +      return "MEMMODEL_RELEASE";
> +    case MEMMODEL_ACQ_REL:
> +      return "MEMMODEL_ACQ_REL";
> +    case MEMMODEL_SEQ_CST:
> +      return "MEMMODEL_SEQ_CST";

The case changes are ok, though it is not handling various
other memory models (MEMMOVED_SYNC_{ACQUIRE,RELEASE,SEQ_CST}).
For the returned strings, that is used in user visible context (warning),
so I think neither is ok, better use "relaxed", "consume", "acquire",
"release", "acq_rel", "seq_cst" (and the rest are internals for __sync_
builtins).

>      default:
>        return NULL;
>      }
> @@ -4442,13 +4442,13 @@ get_memory_order (unsigned memmodel, loc
>  {
>    switch (memmodel)
>      {
> -    case __ATOMIC_RELAXED:
> +    case MEMMODEL_RELAXED:
>        return BRIG_MEMORY_ORDER_RELAXED;
> -    case __ATOMIC_ACQUIRE:
> +    case MEMMODEL_ACQUIRE:
>        return BRIG_MEMORY_ORDER_SC_ACQUIRE;
> -    case __ATOMIC_RELEASE:
> +    case MEMMODEL_RELEASE:
>        return BRIG_MEMORY_ORDER_SC_RELEASE;
> -    case __ATOMIC_ACQ_REL:
> +    case MEMMODEL_ACQ_REL:
>        return BRIG_MEMORY_ORDER_SC_ACQUIRE_RELEASE;
>      default:
>        HSA_SORRY_ATV (location,

This LGTM (though I'm really surprised it doesn't have seq_cst,
e.g. OpenMP #pragma omp atomic will be either relaxed, or seq_cst.

	Jakub

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

* Re: [PATCH] Fix bootstrap with older and non-GCC host compilers
  2016-01-19 14:33 ` Jakub Jelinek
@ 2016-01-19 15:08   ` Richard Biener
  0 siblings, 0 replies; 3+ messages in thread
From: Richard Biener @ 2016-01-19 15:08 UTC (permalink / raw)
  To: Jakub Jelinek; +Cc: gcc-patches, Martin Jambor

On Tue, 19 Jan 2016, Jakub Jelinek wrote:

> On Tue, Jan 19, 2016 at 03:19:17PM +0100, Richard Biener wrote:
> > 
> > It also seems we're wrongly using values defined for the host while
> > looking at GIMPLE IL for the target.
> > 
> > Bootstrap / regtest running on x86_64-unknown-linux-gnu.
> > 
> > Ok?
> > 
> > Richard.
> > 
> > 2016-01-19  Richard Biener  <rguenther@suse.de>
> > 
> > 	* hsa-gen.c (get_memory_order_name): Use MEMMODEL_ constants
> > 	and name.
> > 	(get_memory_order): Likewise.
> > 
> > Index: gcc/hsa-gen.c
> > ===================================================================
> > --- gcc/hsa-gen.c	(revision 232561)
> > +++ gcc/hsa-gen.c	(working copy)
> > @@ -4417,18 +4417,18 @@ get_memory_order_name (unsigned memmodel
> >  {
> >    switch (memmodel)
> >      {
> > -    case __ATOMIC_RELAXED:
> > -      return "__ATOMIC_RELAXED";
> > -    case __ATOMIC_CONSUME:
> > -      return "__ATOMIC_CONSUME";
> > -    case __ATOMIC_ACQUIRE:
> > -      return "__ATOMIC_ACQUIRE";
> > -    case __ATOMIC_RELEASE:
> > -      return "__ATOMIC_RELEASE";
> > -    case __ATOMIC_ACQ_REL:
> > -      return "__ATOMIC_ACQ_REL";
> > -    case __ATOMIC_SEQ_CST:
> > -      return "__ATOMIC_SEQ_CST";
> > +    case MEMMODEL_RELAXED:
> > +      return "MEMMODEL_RELAXED";
> > +    case MEMMODEL_CONSUME:
> > +      return "MEMMODEL_CONSUME";
> > +    case MEMMODEL_ACQUIRE:
> > +      return "MEMMODEL_ACQUIRE";
> > +    case MEMMODEL_RELEASE:
> > +      return "MEMMODEL_RELEASE";
> > +    case MEMMODEL_ACQ_REL:
> > +      return "MEMMODEL_ACQ_REL";
> > +    case MEMMODEL_SEQ_CST:
> > +      return "MEMMODEL_SEQ_CST";
> 
> The case changes are ok, though it is not handling various
> other memory models (MEMMOVED_SYNC_{ACQUIRE,RELEASE,SEQ_CST}).
> For the returned strings, that is used in user visible context (warning),
> so I think neither is ok, better use "relaxed", "consume", "acquire",
> "release", "acq_rel", "seq_cst" (and the rest are internals for __sync_
> builtins).
> 
> >      default:
> >        return NULL;
> >      }
> > @@ -4442,13 +4442,13 @@ get_memory_order (unsigned memmodel, loc
> >  {
> >    switch (memmodel)
> >      {
> > -    case __ATOMIC_RELAXED:
> > +    case MEMMODEL_RELAXED:
> >        return BRIG_MEMORY_ORDER_RELAXED;
> > -    case __ATOMIC_ACQUIRE:
> > +    case MEMMODEL_ACQUIRE:
> >        return BRIG_MEMORY_ORDER_SC_ACQUIRE;
> > -    case __ATOMIC_RELEASE:
> > +    case MEMMODEL_RELEASE:
> >        return BRIG_MEMORY_ORDER_SC_RELEASE;
> > -    case __ATOMIC_ACQ_REL:
> > +    case MEMMODEL_ACQ_REL:
> >        return BRIG_MEMORY_ORDER_SC_ACQUIRE_RELEASE;
> >      default:
> >        HSA_SORRY_ATV (location,
> 
> This LGTM (though I'm really surprised it doesn't have seq_cst,
> e.g. OpenMP #pragma omp atomic will be either relaxed, or seq_cst.

I'll defer the diagnostic name change to Martin then and commit the
following to unbreak the build.

Richard.

2016-01-19  Richard Biener  <rguenther@suse.de>

	* hsa-gen.c (get_memory_order_name): Use MEMMODEL_ constants
	and name.
	(get_memory_order): Likewise.

Index: gcc/hsa-gen.c
===================================================================
--- gcc/hsa-gen.c	(revision 232564)
+++ gcc/hsa-gen.c	(working copy)
@@ -4417,17 +4417,17 @@ get_memory_order_name (unsigned memmodel
 {
   switch (memmodel)
     {
-    case __ATOMIC_RELAXED:
+    case MEMMODEL_RELAXED:
       return "__ATOMIC_RELAXED";
-    case __ATOMIC_CONSUME:
+    case MEMMODEL_CONSUME:
       return "__ATOMIC_CONSUME";
-    case __ATOMIC_ACQUIRE:
+    case MEMMODEL_ACQUIRE:
       return "__ATOMIC_ACQUIRE";
-    case __ATOMIC_RELEASE:
+    case MEMMODEL_RELEASE:
       return "__ATOMIC_RELEASE";
-    case __ATOMIC_ACQ_REL:
+    case MEMMODEL_ACQ_REL:
       return "__ATOMIC_ACQ_REL";
-    case __ATOMIC_SEQ_CST:
+    case MEMMODEL_SEQ_CST:
       return "__ATOMIC_SEQ_CST";
     default:
       return NULL;
@@ -4442,13 +4442,13 @@ get_memory_order (unsigned memmodel, loc
 {
   switch (memmodel)
     {
-    case __ATOMIC_RELAXED:
+    case MEMMODEL_RELAXED:
       return BRIG_MEMORY_ORDER_RELAXED;
-    case __ATOMIC_ACQUIRE:
+    case MEMMODEL_ACQUIRE:
       return BRIG_MEMORY_ORDER_SC_ACQUIRE;
-    case __ATOMIC_RELEASE:
+    case MEMMODEL_RELEASE:
       return BRIG_MEMORY_ORDER_SC_RELEASE;
-    case __ATOMIC_ACQ_REL:
+    case MEMMODEL_ACQ_REL:
       return BRIG_MEMORY_ORDER_SC_ACQUIRE_RELEASE;
     default:
       HSA_SORRY_ATV (location,

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

end of thread, other threads:[~2016-01-19 15:08 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-01-19 14:19 [PATCH] Fix bootstrap with older and non-GCC host compilers Richard Biener
2016-01-19 14:33 ` Jakub Jelinek
2016-01-19 15:08   ` Richard Biener

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