__vector_pair built-in types. They are target specific and
only available when MMA is supported. With MMA supported, it
simply returns true, otherwise it checks if the given gimple
- STMT is an assignment or asm stmt and uses either of these two
- opaque types unexpectedly, if yes, it would raise an error
- message and returns true, otherwise it returns false. */
+ STMT is an assignment, asm or call stmt and uses either of
+ these two opaque types unexpectedly, if yes, it would raise
+ an error message and returns true, otherwise it returns false. */
bool
rs6000_opaque_type_invalid_use_p (gimple *stmt)
if (stmt)
{
/* The usage of MMA opaque types is very limited for now,
- to check with gassign and gasm is enough so far. */
+ to check with gassign, gasm and gcall is enough so far. */
if (gassign *ga = dyn_cast<gassign *> (stmt))
{
tree lhs = gimple_assign_lhs (ga);
return true;
}
}
+ else if (gcall *gc = dyn_cast<gcall *> (stmt))
+ {
+ unsigned nargs = gimple_call_num_args (gc);
+ for (unsigned i = 0; i < nargs; i++)
+ {
+ tree arg = gimple_call_arg (gc, i);
+ tree type = TREE_TYPE (arg);
+ if (check_and_error_invalid_use (type))
+ return true;
+ }
+ }
}
return false;
--- /dev/null
+/* { dg-require-effective-target powerpc_altivec_ok } */
+/* If the default cpu type is power10 or later, type __vector_quad is
+ supported. To keep the test point available all the time, this case
+ specifies -mdejagnu-cpu=power9 here. This needs -mabi=no-altivec
+ to do the copying for pass-by-reference function argument on 32 bit
+ environment. */
+/* { dg-options "-mdejagnu-cpu=power9 -mabi=no-altivec" } */
+
+/* Verify there is no ICE on 32 bit and don't check the error messages
+ on unsupported type since they could be fragile and are not test
+ points of this case. */
+
+/* { dg-excess-errors "pr108348-1" } */
+
+extern void bar (__vector_quad v);
+
+void
+foo (void)
+{
+ __vector_quad v;
+ bar (v);
+}
+
--- /dev/null
+/* { dg-require-effective-target powerpc_altivec_ok } */
+/* If the default cpu type is power10 or later, type __vector_pair is
+ supported. To keep the test point available all the time, this case
+ specifies -mdejagnu-cpu=power9 here. This needs -mabi=no-altivec
+ to do the copying for pass-by-reference function argument on 32 bit
+ environment. */
+/* { dg-options "-mdejagnu-cpu=power9 -mabi=no-altivec" } */
+
+/* Verify there is no ICE on 32 bit and don't check the error messages
+ on unsupported type since they could be fragile and are not test
+ points of this case. */
+
+/* { dg-excess-errors "pr108348-2" } */
+
+extern void bar (__vector_pair v);
+
+void
+foo (void)
+{
+ __vector_pair v;
+ bar (v);
+}
+