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

acsawdey at gcc dot gnu.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2017-02-24
     Ever confirmed|0                           |1

--- Comment #1 from acsawdey at gcc dot gnu.org ---
So, what is going on here is as follows:

Everything in gcc.dg/vmx runs with -mno-vsx. This disables power8-vector which
in turn disables power9-vector. So far so good. If you compile this test case
with -mno-vsx -mcpu=power8 it is fine (no errors) and you get code involving a
vcmpequb, which is ok because it's a legacy altivec instruction.

However with -mno-vsx -mcpu=power9 you get these errors because it's still
trying to use the power9 builtin and then gets farther along and discovers it's
not available because power9 vector is disabled. 

#0  error (gmsgid=0x11e60a68 "Builtin function %s requires the -mcpu=power9
option") at ../../trunk/gcc/diagnostic.c:1308
#1  0x00000000113b9fdc in rs6000_invalid_builtin (fncode=P9V_BUILTIN_VCMPNEB_P)
at ../../trunk/gcc/config/rs6000/rs6000.c:16738
#2  0x00000000113bab58 in rs6000_expand_builtin (exp=0x3fffb5cf4b80,
target=0x0, subtarget=0x0, mode=DImode, ignore=0) at
../../trunk/gcc/config/rs6000/rs6000.c:16945
#3  0x000000001056f3e0 in expand_builtin (exp=0x3fffb5cf4b80, target=0x0,
subtarget=0x0, mode=DImode, ignore=0) at ../../trunk/gcc/builtins.c:6362

16737     else if ((fnmask & RS6000_BTM_P9_VECTOR) != 0)
16738       error ("Builtin function %s requires the -mcpu=power9 option",
name);

(gdb) p/x rs6000_isa_flags
$2 = 0x206ee1c4d601f
        0x1000000000  <-- MASK_P9_VECTOR, not set because of -mno-vsx

I think there are two separate things that ought to be fixed:

* the builtins should work with -mno-vsx -mcpu=power9 just like they did with
-mno-vsx -mcpu=power8
* possibly the tests like 3d-01.c should move to gcc.dg/powerpc because
arguably for -mcpu=power9 we are not testing them fully because of -mno-vsx.

Reply via email to