@@ -4557,8 +4557,13 @@ gen_hsa_ternary_atomic_for_builtin (bool ret_orig,
hsa_op_address *addr;
addr = get_address_from_value (gimple_call_arg (stmt, 0), hbb);
- /* TODO: Warn if addr has private segment, because the finalizer will not
- accept that (and it does not make much sense). */
+ if (addr->m_symbol && addr->m_symbol->m_segment == BRIG_SEGMENT_PRIVATE)
+ {
+ HSA_SORRY_AT (gimple_location (stmt),
+ "HSA does not implement atomic operations in private "
+ "segment");
+ return;
+ }
hsa_op_base *op = hsa_reg_or_immed_for_gimple_op (gimple_call_arg (stmt, 1),
hbb);