[Bug target/80482] New: [7 Regression] vec_mul produces compilation error if 1 of its parms is const or volatile

seurer at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Fri Apr 21 13:59:00 GMT 2017


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80482

            Bug ID: 80482
           Summary: [7 Regression] vec_mul produces compilation error if 1
                    of its parms is const or volatile
           Product: gcc
           Version: 7.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: target
          Assignee: unassigned at gcc dot gnu.org
          Reporter: seurer at gcc dot gnu.org
  Target Milestone: ---

If one (just one) of its parameters is const, volatile, or const volatile
vec_mul produces a compilation error.  This occurs for gcc 7 but not 5 nor 6.

For example:

#include <altivec.h>

void P() {

  const volatile vector float cvva = vec_splats(0.00187682f);
  volatile vector float vva = vec_splats(0.00187682f);
  const vector float cva = vec_splats(0.00187682f);
  vector float va = vec_splats(0.00187682f);
  vector float dx = {1.0f, 2.0f, 3.0f, 4.0f};

  vector float X1m0 = vec_mul(va, va);
  vector float X2m0 = vec_mul(va, dx);
  vector float X3m0 = vec_mul(dx, va);

  vector float X1m1 = vec_mul(cva, cva);
  vector float X2m1 = vec_mul(cva, dx);
  vector float X3m1 = vec_mul(dx, cva);

  vector float Y1m2 = vec_mul(vva, vva);
  vector float Y2m2 = vec_mul(vva, dx);
  vector float Y3m2 = vec_mul(dx, vva);

  vector float X1m3 = vec_mul(cvva, cvva);
  vector float X2m3 = vec_mul(cvva, dx);
  vector float X3m3 = vec_mul(dx, cvva);
}

bii.c:16:3: error: invalid parameter combination for AltiVec intrinsic
__builtin_vec_mul
   vector float X2m1 = vec_mul(cva, dx);
   ^~~~~~
bii.c:17:3: error: invalid parameter combination for AltiVec intrinsic
__builtin_vec_mul
   vector float X3m1 = vec_mul(dx, cva);
   ^~~~~~
bii.c:20:3: error: invalid parameter combination for AltiVec intrinsic
__builtin_vec_mul
   vector float Y2m2 = vec_mul(vva, dx);
   ^~~~~~
bii.c:21:3: error: invalid parameter combination for AltiVec intrinsic
__builtin_vec_mul
   vector float Y3m2 = vec_mul(dx, vva);
   ^~~~~~
bii.c:24:3: error: invalid parameter combination for AltiVec intrinsic
__builtin_vec_mul
   vector float X2m3 = vec_mul(cvva, dx);
   ^~~~~~
bii.c:25:3: error: invalid parameter combination for AltiVec intrinsic
__builtin_vec_mul
   vector float X3m3 = vec_mul(dx, cvva);
   ^~~~~~

I tried a few of the other vec_XYZ built-ins and they do not produce the same
error (though I did not test them all).

Note that I am investigating this further.


More information about the Gcc-bugs mailing list