Discussion:
[PATCH 0/3] nouveau compiler warning cleanups
(too old to reply)
Rhys Kidd
2017-12-02 18:22:42 UTC
Permalink
Couple of little compiler warning cleanups so that nouveau builds without any
warnings for meson's debug and release builds with gcc 7.2.0

Rhys Kidd (3):
nv50: Fix unused var warning in release build
nvc0: Fix unused var warnings in release build
nv50/ir: Fix unused var warnings in release build

src/gallium/drivers/nouveau/codegen/nv50_ir_emit_nv50.cpp | 2 +-
src/gallium/drivers/nouveau/codegen/nv50_ir_peephole.cpp | 2 +-
src/gallium/drivers/nouveau/nv50/nv98_video.c | 3 ++-
src/gallium/drivers/nouveau/nvc0/nvc0_video.c | 7 ++++---
4 files changed, 8 insertions(+), 6 deletions(-)
--
2.14.1
Rhys Kidd
2017-12-02 18:22:43 UTC
Permalink
Signed-off-by: Rhys Kidd <***@gmail.com>
---
src/gallium/drivers/nouveau/nv50/nv98_video.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/gallium/drivers/nouveau/nv50/nv98_video.c b/src/gallium/drivers/nouveau/nv50/nv98_video.c
index 92526d9f64..da0267e646 100644
--- a/src/gallium/drivers/nouveau/nv50/nv98_video.c
+++ b/src/gallium/drivers/nouveau/nv50/nv98_video.c
@@ -40,7 +40,8 @@ nv98_decoder_decode_bitstream(struct pipe_video_codec *decoder,
uint32_t comm_seq = ++dec->fence_seq;
union pipe_desc desc;

- unsigned vp_caps, is_ref, ret;
+ unsigned vp_caps, is_ref;
+ MAYBE_UNUSED unsigned ret; /* used in debug checks */
struct nouveau_vp3_video_buffer *refs[16] = {};

desc.base = picture;
--
2.14.1
Rhys Kidd
2017-12-02 18:22:44 UTC
Permalink
Signed-off-by: Rhys Kidd <***@gmail.com>
---
src/gallium/drivers/nouveau/nvc0/nvc0_video.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/src/gallium/drivers/nouveau/nvc0/nvc0_video.c b/src/gallium/drivers/nouveau/nvc0/nvc0_video.c
index b5e7bba5f9..5c1cf899ca 100644
--- a/src/gallium/drivers/nouveau/nvc0/nvc0_video.c
+++ b/src/gallium/drivers/nouveau/nvc0/nvc0_video.c
@@ -32,7 +32,7 @@ nvc0_decoder_begin_frame(struct pipe_video_codec *decoder,
{
struct nouveau_vp3_decoder *dec = (struct nouveau_vp3_decoder *)decoder;
uint32_t comm_seq = ++dec->fence_seq;
- unsigned ret = 0;
+ MAYBE_UNUSED unsigned ret = 0; /* used in debug checks */

assert(dec);
assert(target);
@@ -53,7 +53,7 @@ nvc0_decoder_decode_bitstream(struct pipe_video_codec *decoder,
{
struct nouveau_vp3_decoder *dec = (struct nouveau_vp3_decoder *)decoder;
uint32_t comm_seq = dec->fence_seq;
- unsigned ret = 0;
+ MAYBE_UNUSED unsigned ret = 0; /* used in debug checks */

assert(decoder);

@@ -72,7 +72,8 @@ nvc0_decoder_end_frame(struct pipe_video_codec *decoder,
uint32_t comm_seq = dec->fence_seq;
union pipe_desc desc;

- unsigned vp_caps, is_ref, ret;
+ unsigned vp_caps, is_ref;
+ MAYBE_UNUSED unsigned ret; /* used in debug checks */
struct nouveau_vp3_video_buffer *refs[16] = {};

desc.base = picture;
--
2.14.1
Rhys Kidd
2017-12-02 18:22:45 UTC
Permalink
Signed-off-by: Rhys Kidd <***@gmail.com>
---
src/gallium/drivers/nouveau/codegen/nv50_ir_emit_nv50.cpp | 2 +-
src/gallium/drivers/nouveau/codegen/nv50_ir_peephole.cpp | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/gallium/drivers/nouveau/codegen/nv50_ir_emit_nv50.cpp b/src/gallium/drivers/nouveau/codegen/nv50_ir_emit_nv50.cpp
index cc2a88eb40..139ff4a31d 100644
--- a/src/gallium/drivers/nouveau/codegen/nv50_ir_emit_nv50.cpp
+++ b/src/gallium/drivers/nouveau/codegen/nv50_ir_emit_nv50.cpp
@@ -621,7 +621,7 @@ void
CodeEmitterNV50::emitLOAD(const Instruction *i)
{
DataFile sf = i->src(0).getFile();
- int32_t offset = i->getSrc(0)->reg.data.offset;
+ MAYBE_UNUSED int32_t offset = i->getSrc(0)->reg.data.offset;

switch (sf) {
case FILE_SHADER_INPUT:
diff --git a/src/gallium/drivers/nouveau/codegen/nv50_ir_peephole.cpp b/src/gallium/drivers/nouveau/codegen/nv50_ir_peephole.cpp
index 61d4e6a2d0..f49459b969 100644
--- a/src/gallium/drivers/nouveau/codegen/nv50_ir_peephole.cpp
+++ b/src/gallium/drivers/nouveau/codegen/nv50_ir_peephole.cpp
@@ -3308,7 +3308,7 @@ PostRaLoadPropagation::handleMADforNV50(Instruction *i)
i->setSrc(1, def->getSrc(0));
} else {
ImmediateValue val;
- bool ret = def->src(0).getImmediate(val);
+ MAYBE_UNUSED bool ret = def->src(0).getImmediate(val);
assert(ret);
if (i->getSrc(1)->reg.data.id & 1)
val.reg.data.u32 >>= 16;
--
2.14.1
Ilia Mirkin
2017-12-02 18:28:04 UTC
Permalink
Post by Rhys Kidd
---
src/gallium/drivers/nouveau/codegen/nv50_ir_emit_nv50.cpp | 2 +-
src/gallium/drivers/nouveau/codegen/nv50_ir_peephole.cpp | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/gallium/drivers/nouveau/codegen/nv50_ir_emit_nv50.cpp b/src/gallium/drivers/nouveau/codegen/nv50_ir_emit_nv50.cpp
index cc2a88eb40..139ff4a31d 100644
--- a/src/gallium/drivers/nouveau/codegen/nv50_ir_emit_nv50.cpp
+++ b/src/gallium/drivers/nouveau/codegen/nv50_ir_emit_nv50.cpp
@@ -621,7 +621,7 @@ void
CodeEmitterNV50::emitLOAD(const Instruction *i)
{
DataFile sf = i->src(0).getFile();
- int32_t offset = i->getSrc(0)->reg.data.offset;
+ MAYBE_UNUSED int32_t offset = i->getSrc(0)->reg.data.offset;
switch (sf) {
diff --git a/src/gallium/drivers/nouveau/codegen/nv50_ir_peephole.cpp b/src/gallium/drivers/nouveau/codegen/nv50_ir_peephole.cpp
index 61d4e6a2d0..f49459b969 100644
--- a/src/gallium/drivers/nouveau/codegen/nv50_ir_peephole.cpp
+++ b/src/gallium/drivers/nouveau/codegen/nv50_ir_peephole.cpp
@@ -3308,7 +3308,7 @@ PostRaLoadPropagation::handleMADforNV50(Instruction *i)
i->setSrc(1, def->getSrc(0));
} else {
ImmediateValue val;
- bool ret = def->src(0).getImmediate(val);
+ MAYBE_UNUSED bool ret = def->src(0).getImmediate(val);
Can you write a comment mentioning that getImmediate() has
side-effects on the argument, so this *shouldn't* get folded into the
assert? My concern is that with the MAYBE_UNUSED there, someone with a
twitchy thumb may be tempted to press that button...

-ilia
Post by Rhys Kidd
assert(ret);
if (i->getSrc(1)->reg.data.id & 1)
val.reg.data.u32 >>= 16;
--
2.14.1
_______________________________________________
mesa-dev mailing list
https://lists.freedesktop.org/mailman/listinfo/mesa-dev
Eric Engestrom
2017-12-04 16:19:31 UTC
Permalink
Post by Ilia Mirkin
Post by Rhys Kidd
---
src/gallium/drivers/nouveau/codegen/nv50_ir_emit_nv50.cpp | 2 +-
src/gallium/drivers/nouveau/codegen/nv50_ir_peephole.cpp | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/gallium/drivers/nouveau/codegen/nv50_ir_emit_nv50.cpp b/src/gallium/drivers/nouveau/codegen/nv50_ir_emit_nv50.cpp
index cc2a88eb40..139ff4a31d 100644
--- a/src/gallium/drivers/nouveau/codegen/nv50_ir_emit_nv50.cpp
+++ b/src/gallium/drivers/nouveau/codegen/nv50_ir_emit_nv50.cpp
@@ -621,7 +621,7 @@ void
CodeEmitterNV50::emitLOAD(const Instruction *i)
{
DataFile sf = i->src(0).getFile();
- int32_t offset = i->getSrc(0)->reg.data.offset;
+ MAYBE_UNUSED int32_t offset = i->getSrc(0)->reg.data.offset;
switch (sf) {
diff --git a/src/gallium/drivers/nouveau/codegen/nv50_ir_peephole.cpp b/src/gallium/drivers/nouveau/codegen/nv50_ir_peephole.cpp
index 61d4e6a2d0..f49459b969 100644
--- a/src/gallium/drivers/nouveau/codegen/nv50_ir_peephole.cpp
+++ b/src/gallium/drivers/nouveau/codegen/nv50_ir_peephole.cpp
@@ -3308,7 +3308,7 @@ PostRaLoadPropagation::handleMADforNV50(Instruction *i)
i->setSrc(1, def->getSrc(0));
} else {
ImmediateValue val;
- bool ret = def->src(0).getImmediate(val);
+ MAYBE_UNUSED bool ret = def->src(0).getImmediate(val);
Can you write a comment mentioning that getImmediate() has
side-effects on the argument, so this *shouldn't* get folded into the
assert? My concern is that with the MAYBE_UNUSED there, someone with a
twitchy thumb may be tempted to press that button...
Being someone with such a twitchy thumb, I approve of adding this
comment :)
Post by Ilia Mirkin
-ilia
Post by Rhys Kidd
assert(ret);
if (i->getSrc(1)->reg.data.id & 1)
val.reg.data.u32 >>= 16;
--
2.14.1
_______________________________________________
mesa-dev mailing list
https://lists.freedesktop.org/mailman/listinfo/mesa-dev
_______________________________________________
mesa-dev mailing list
https://lists.freedesktop.org/mailman/listinfo/mesa-dev
Rhys Kidd
2017-12-16 12:00:08 UTC
Permalink
Couple of little compiler warning cleanups so that nouveau builds without any
warnings for meson's debug and release builds with gcc 7.2.0

v2: Add preventative comment (Ilia Mirkin)

Rhys Kidd (3):
nv50: Fix unused var warning in release build
nvc0: Fix unused var warnings in release build
nv50/ir: Fix unused var warnings in release build

src/gallium/drivers/nouveau/codegen/nv50_ir_emit_nv50.cpp | 2 +-
src/gallium/drivers/nouveau/codegen/nv50_ir_peephole.cpp | 4 +++-
src/gallium/drivers/nouveau/nv50/nv98_video.c | 3 ++-
src/gallium/drivers/nouveau/nvc0/nvc0_video.c | 7 ++++---
4 files changed, 10 insertions(+), 6 deletions(-)
--
2.14.1
Rhys Kidd
2017-12-16 12:00:09 UTC
Permalink
Signed-off-by: Rhys Kidd <***@gmail.com>
---
src/gallium/drivers/nouveau/nv50/nv98_video.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/gallium/drivers/nouveau/nv50/nv98_video.c b/src/gallium/drivers/nouveau/nv50/nv98_video.c
index 92526d9f64..da0267e646 100644
--- a/src/gallium/drivers/nouveau/nv50/nv98_video.c
+++ b/src/gallium/drivers/nouveau/nv50/nv98_video.c
@@ -40,7 +40,8 @@ nv98_decoder_decode_bitstream(struct pipe_video_codec *decoder,
uint32_t comm_seq = ++dec->fence_seq;
union pipe_desc desc;

- unsigned vp_caps, is_ref, ret;
+ unsigned vp_caps, is_ref;
+ MAYBE_UNUSED unsigned ret; /* used in debug checks */
struct nouveau_vp3_video_buffer *refs[16] = {};

desc.base = picture;
--
2.14.1
Rhys Kidd
2017-12-16 12:00:10 UTC
Permalink
Signed-off-by: Rhys Kidd <***@gmail.com>
---
src/gallium/drivers/nouveau/nvc0/nvc0_video.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/src/gallium/drivers/nouveau/nvc0/nvc0_video.c b/src/gallium/drivers/nouveau/nvc0/nvc0_video.c
index b5e7bba5f9..5c1cf899ca 100644
--- a/src/gallium/drivers/nouveau/nvc0/nvc0_video.c
+++ b/src/gallium/drivers/nouveau/nvc0/nvc0_video.c
@@ -32,7 +32,7 @@ nvc0_decoder_begin_frame(struct pipe_video_codec *decoder,
{
struct nouveau_vp3_decoder *dec = (struct nouveau_vp3_decoder *)decoder;
uint32_t comm_seq = ++dec->fence_seq;
- unsigned ret = 0;
+ MAYBE_UNUSED unsigned ret = 0; /* used in debug checks */

assert(dec);
assert(target);
@@ -53,7 +53,7 @@ nvc0_decoder_decode_bitstream(struct pipe_video_codec *decoder,
{
struct nouveau_vp3_decoder *dec = (struct nouveau_vp3_decoder *)decoder;
uint32_t comm_seq = dec->fence_seq;
- unsigned ret = 0;
+ MAYBE_UNUSED unsigned ret = 0; /* used in debug checks */

assert(decoder);

@@ -72,7 +72,8 @@ nvc0_decoder_end_frame(struct pipe_video_codec *decoder,
uint32_t comm_seq = dec->fence_seq;
union pipe_desc desc;

- unsigned vp_caps, is_ref, ret;
+ unsigned vp_caps, is_ref;
+ MAYBE_UNUSED unsigned ret; /* used in debug checks */
struct nouveau_vp3_video_buffer *refs[16] = {};

desc.base = picture;
--
2.14.1
Rhys Kidd
2017-12-16 12:00:11 UTC
Permalink
v2: Add preventative comment (Ilia Mirkin)

Reviewed-by: Eric Engestrom <***@imgtec.com>
Signed-off-by: Rhys Kidd <***@gmail.com>
---
src/gallium/drivers/nouveau/codegen/nv50_ir_emit_nv50.cpp | 2 +-
src/gallium/drivers/nouveau/codegen/nv50_ir_peephole.cpp | 4 +++-
2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/src/gallium/drivers/nouveau/codegen/nv50_ir_emit_nv50.cpp b/src/gallium/drivers/nouveau/codegen/nv50_ir_emit_nv50.cpp
index cc2a88eb40..139ff4a31d 100644
--- a/src/gallium/drivers/nouveau/codegen/nv50_ir_emit_nv50.cpp
+++ b/src/gallium/drivers/nouveau/codegen/nv50_ir_emit_nv50.cpp
@@ -621,7 +621,7 @@ void
CodeEmitterNV50::emitLOAD(const Instruction *i)
{
DataFile sf = i->src(0).getFile();
- int32_t offset = i->getSrc(0)->reg.data.offset;
+ MAYBE_UNUSED int32_t offset = i->getSrc(0)->reg.data.offset;

switch (sf) {
case FILE_SHADER_INPUT:
diff --git a/src/gallium/drivers/nouveau/codegen/nv50_ir_peephole.cpp b/src/gallium/drivers/nouveau/codegen/nv50_ir_peephole.cpp
index 61d4e6a2d0..0bbf21312f 100644
--- a/src/gallium/drivers/nouveau/codegen/nv50_ir_peephole.cpp
+++ b/src/gallium/drivers/nouveau/codegen/nv50_ir_peephole.cpp
@@ -3308,7 +3308,9 @@ PostRaLoadPropagation::handleMADforNV50(Instruction *i)
i->setSrc(1, def->getSrc(0));
} else {
ImmediateValue val;
- bool ret = def->src(0).getImmediate(val);
+ // getImmediate() has side-effects on the argument so this *shouldn't*
+ // be folded into the assert()
+ MAYBE_UNUSED bool ret = def->src(0).getImmediate(val);
assert(ret);
if (i->getSrc(1)->reg.data.id & 1)
val.reg.data.u32 >>= 16;
--
2.14.1
Pierre Moreau
2017-12-29 22:07:46 UTC
Permalink
Series is
Post by Rhys Kidd
Couple of little compiler warning cleanups so that nouveau builds without any
warnings for meson's debug and release builds with gcc 7.2.0
v2: Add preventative comment (Ilia Mirkin)
nv50: Fix unused var warning in release build
nvc0: Fix unused var warnings in release build
nv50/ir: Fix unused var warnings in release build
src/gallium/drivers/nouveau/codegen/nv50_ir_emit_nv50.cpp | 2 +-
src/gallium/drivers/nouveau/codegen/nv50_ir_peephole.cpp | 4 +++-
src/gallium/drivers/nouveau/nv50/nv98_video.c | 3 ++-
src/gallium/drivers/nouveau/nvc0/nvc0_video.c | 7 ++++---
4 files changed, 10 insertions(+), 6 deletions(-)
--
2.14.1
_______________________________________________
mesa-dev mailing list
https://lists.freedesktop.org/mailman/listinfo/mesa-dev
Rhys Kidd
2017-12-30 04:17:38 UTC
Permalink
Post by Pierre Moreau
Series is
Committed to upstream master.

remote: Updating patchwork state for
https://patchwork.freedesktop.org/project/mesa/list/
remote: I: patch #191536 updated using rev
540d829d383742b9aa0d4394366d09adde31c9b5
remote: I: patch #191537 updated using rev
634ca4c2c3edf7b0a6f32d02e6a4e86316019377
remote: I: patch #193642 updated using rev
60c2d094831a2238551b6959d045638e78706924
remote: I: 3 patch(es) updated to state Accepted.
To ssh://git.freedesktop.org/git/mesa/mesa.git
878bc4a5ae..60c2d09483 master -> master
Post by Pierre Moreau
Post by Rhys Kidd
Couple of little compiler warning cleanups so that nouveau builds
without any
Post by Rhys Kidd
warnings for meson's debug and release builds with gcc 7.2.0
v2: Add preventative comment (Ilia Mirkin)
nv50: Fix unused var warning in release build
nvc0: Fix unused var warnings in release build
nv50/ir: Fix unused var warnings in release build
src/gallium/drivers/nouveau/codegen/nv50_ir_emit_nv50.cpp | 2 +-
src/gallium/drivers/nouveau/codegen/nv50_ir_peephole.cpp | 4 +++-
src/gallium/drivers/nouveau/nv50/nv98_video.c | 3 ++-
src/gallium/drivers/nouveau/nvc0/nvc0_video.c | 7 ++++---
4 files changed, 10 insertions(+), 6 deletions(-)
--
2.14.1
_______________________________________________
mesa-dev mailing list
https://lists.freedesktop.org/mailman/listinfo/mesa-dev
Loading...