[2/2] PR 78736: libgomp fallout

Message ID CAAgBjM=P4mwfgm_x5fqPmQv+abLtTp_hFSRDPpV80R6pUjmi0A@mail.gmail.com
State New
Headers show
Series
  • Untitled series #1285
Related show

Commit Message

Prathamesh Kulkarni May 2, 2017, 5:13 p.m.
Hi,
During gcc bootstrap, there's a couple of places where the warning got
triggered.
I suppose this wasn't a false positive since enum gomp_schedule_type
and enum omp_sched_t
are different types (although they have same set of values) ?

Bootstrap+tested on x86_64-unknown-linux-gnu.
Is this patch OK to commit ?

Thanks,
Prathamesh
2017-05-02  Prathamesh Kulkarni  <prathamesh.kulkarni@linaro.org>

	* icv.c (omp_set_schedule): Cast kind to enum gomp_schedule_type
	before assigning to icv->run_sched_var.
	(omp_get_schedule): Cast icv->run_sched_var to enum omp_sched_t before
	assigning it to *kind.

Comments

Prathamesh Kulkarni May 9, 2017, 1:25 p.m. | #1
ping https://gcc.gnu.org/ml/gcc-patches/2017-05/msg00135.html

Thanks,
Prathamesh

On 2 May 2017 at 22:43, Prathamesh Kulkarni
<prathamesh.kulkarni@linaro.org> wrote:
> Hi,

> During gcc bootstrap, there's a couple of places where the warning got

> triggered.

> I suppose this wasn't a false positive since enum gomp_schedule_type

> and enum omp_sched_t

> are different types (although they have same set of values) ?

>

> Bootstrap+tested on x86_64-unknown-linux-gnu.

> Is this patch OK to commit ?

>

> Thanks,

> Prathamesh
Jakub Jelinek May 9, 2017, 1:29 p.m. | #2
On Tue, May 09, 2017 at 06:55:12PM +0530, Prathamesh Kulkarni wrote:
> ping https://gcc.gnu.org/ml/gcc-patches/2017-05/msg00135.html


The libgomp patch is ok provided the warning is added.
Though, should it be in -Wall and not say just -Wextra?

	Jakub

Patch hide | download patch | download mbox

diff --git a/libgomp/icv.c b/libgomp/icv.c
index 233d6dbe10e..71e1f677fd7 100644
--- a/libgomp/icv.c
+++ b/libgomp/icv.c
@@ -87,14 +87,14 @@  omp_set_schedule (omp_sched_t kind, int chunk_size)
     default:
       return;
     }
-  icv->run_sched_var = kind;
+  icv->run_sched_var = (enum gomp_schedule_type) kind;
 }
 
 void
 omp_get_schedule (omp_sched_t *kind, int *chunk_size)
 {
   struct gomp_task_icv *icv = gomp_icv (false);
-  *kind = icv->run_sched_var;
+  *kind = (enum omp_sched_t) icv->run_sched_var;
   *chunk_size = icv->run_sched_chunk_size;
 }