The verification added in
r12-1608-g2f1686ff70b25f, was incorrect
for PAREN_EXPR, pointer types should be valid for PAREN_EXPR.
Also for PAREN_EXPR, aggregate types don't make sense (currently
they ICE much earlier in the gimplifier rather than error message) so
we should disallow them here too.
Bootstrapped and tested on x86_64-linux-gnu.
PR middle-end/118868
gcc/ChangeLog:
* tree-cfg.cc (verify_gimple_assign_unary): Allow pointers
but disallow aggregate types for PAREN_EXPR.
gcc/testsuite/ChangeLog:
* c-c++-common/pr118868-1.c: New test.
Signed-off-by: Andrew Pinski <quic_apinski@quicinc.com>
--- /dev/null
+/* { dg-do compile } */
+
+/* PR middle-end/118868 */
+
+/* __builtin_assoc_barrier should work on pointers without any ICE */
+void *f(void *a)
+{
+ return __builtin_assoc_barrier(a);
+}
case NEGATE_EXPR:
case ABS_EXPR:
case BIT_NOT_EXPR:
- case PAREN_EXPR:
case CONJ_EXPR:
/* Disallow pointer and offset types for many of the unary gimple. */
if (POINTER_TYPE_P (lhs_type)
}
break;
+ case PAREN_EXPR:
+ /* Disallow non arthmetic types on PAREN_EXPR. */
+ if (AGGREGATE_TYPE_P (lhs_type))
+ {
+ error ("invalid types for %qs", code_name);
+ debug_generic_expr (lhs_type);
+ debug_generic_expr (rhs1_type);
+ return true;
+ }
+ break;
+
case ABSU_EXPR:
if (!ANY_INTEGRAL_TYPE_P (lhs_type)
|| !TYPE_UNSIGNED (lhs_type)