On 8/11/20 9:00 PM, Segher Boessenkool wrote: > On Sun, Aug 09, 2020 at 10:03:35PM -0500, Peter Bergner wrote: >> +/* { dg-options "-mdejagnu-cpu=power10 -O2 -w" } */ > > Do you need -w or could a less heavy hammer work as well?
So adding: extern void bar0(); etc. was enough to get rid of the warnings, so I'll add that and remove the use of -w. >> It's a static local variable, so how is it always zero and unused? > > Oh, trickiness with it being called a second time. Ouch! > > This needs a H U G E comment then... Or better, get rid of that? We cannot really get rid if it. With the code as is, we see for the following test: __vector_quad foo (__vector_quad *src) { return *src; } bug.i: In function ‘foo’: bug.i:2:1: error: invalid use of MMA type ‘__vector_quad’ as a function return value 2 | foo (__vector_quad *src) | ^~~ versus without the fn != cfun condition: bug.i: In function ‘foo’: bug.i:2:1: error: invalid use of MMA type ‘__vector_quad’ as a function return value 2 | foo (__vector_quad *src) | ^~~ bug.i:2:1: error: invalid use of MMA type ‘__vector_quad’ as a function return value bug.i:2:1: error: invalid use of MMA type ‘__vector_quad’ as a function return value bug.i:2:1: error: invalid use of MMA type ‘__vector_quad’ as a function return value bug.i:2:1: error: invalid use of MMA type ‘__vector_quad’ as a function return value bug.i:2:1: error: invalid use of MMA type ‘__vector_quad’ as a function return value bug.i:2:1: error: invalid use of MMA type ‘__vector_quad’ as a function return value bug.i:4:10: error: invalid use of MMA type ‘__vector_quad’ as a function return value 4 | return *src; | ^~~~ I'll modify the test case and add a comment here and then resend the patch. Peter