tree type = TREE_TYPE (TREE_TYPE (fndecl));
enum built_in_function fcode = DECL_FUNCTION_CODE (fndecl);
- if (TREE_CODE (arg0) == ERROR_MARK)
+ if (error_operand_p (arg0))
return NULL_TREE;
if (tree ret = fold_const_call (as_combined_fn (fcode), type, arg0))
tree type = TREE_TYPE (TREE_TYPE (fndecl));
enum built_in_function fcode = DECL_FUNCTION_CODE (fndecl);
- if (TREE_CODE (arg0) == ERROR_MARK
- || TREE_CODE (arg1) == ERROR_MARK)
+ if (error_operand_p (arg0)
+ || error_operand_p (arg1))
return NULL_TREE;
if (tree ret = fold_const_call (as_combined_fn (fcode), type, arg0, arg1))
tree type = TREE_TYPE (TREE_TYPE (fndecl));
enum built_in_function fcode = DECL_FUNCTION_CODE (fndecl);
- if (TREE_CODE (arg0) == ERROR_MARK
- || TREE_CODE (arg1) == ERROR_MARK
- || TREE_CODE (arg2) == ERROR_MARK)
+ if (error_operand_p (arg0)
+ || error_operand_p (arg1)
+ || error_operand_p (arg2))
return NULL_TREE;
if (tree ret = fold_const_call (as_combined_fn (fcode), type,
--- /dev/null
+/* We used to ICE while folding memcpy and memmove.
+ PR c/109619. */
+/* { dg-do compile } */
+/* { dg-options "" } */
+
+int *a1, *a2;
+
+void foo(__SIZE_TYPE__ a3) /* { dg-note "" } */
+{
+ __builtin_memcpy(a1, a2, a3);
+ __builtin_memmove(a1, a2, a3);
+ int *a3; /* { dg-error "redeclared as different kind of symbol" } */
+}
+