2017-11-21 Jakub Jelinek <jakub@redhat.com>
+ PR c++/83059
+ * config/i386/i386.c (ix86_memmodel_check): Start
+ -Winvalid-memory-model diagnostics with lowercase letter.
+
PR debug/82718
* dwarf2out.c (dw_loc_list): If crtl->has_bb_partition, temporarily
set in_cold_section_p to the partition containing loc_list->first.
+2017-11-21 Jakub Jelinek <jakub@redhat.com>
+
+ PR c++/83059
+ * c-common.c (get_atomic_generic_size): Use TREE_INT_CST_LOW
+ instead of tree_to_uhwi, formatting fix.
+
2017-11-20 David Malcolm <dmalcolm@redhat.com>
PR c/81404
tree p = (*params)[x];
if (TREE_CODE (p) == INTEGER_CST)
{
- int i = tree_to_uhwi (p);
- if (i < 0 || (memmodel_base (i) >= MEMMODEL_LAST))
- {
- warning_at (loc, OPT_Winvalid_memory_model,
- "invalid memory model argument %d of %qE", x + 1,
- function);
- }
+ /* memmodel_base masks the low 16 bits, thus ignore any bits above
+ it by using TREE_INT_CST_LOW instead of tree_to_*hwi. Those high
+ bits will be checked later during expansion in target specific
+ way. */
+ if (memmodel_base (TREE_INT_CST_LOW (p)) >= MEMMODEL_LAST)
+ warning_at (loc, OPT_Winvalid_memory_model,
+ "invalid memory model argument %d of %qE", x + 1,
+ function);
}
else
if (!INTEGRAL_TYPE_P (TREE_TYPE (p)))
|| ((val & IX86_HLE_ACQUIRE) && (val & IX86_HLE_RELEASE)))
{
warning (OPT_Winvalid_memory_model,
- "Unknown architecture specific memory model");
+ "unknown architecture specific memory model");
return MEMMODEL_SEQ_CST;
}
strong = (is_mm_acq_rel (model) || is_mm_seq_cst (model));
2017-11-21 Jakub Jelinek <jakub@redhat.com>
+ PR c++/83059
+ * c-c++-common/pr83059.c: New test.
+
PR debug/82718
* gcc.dg/debug/dwarf2/pr82718-1.c: New test.
* gcc.dg/debug/dwarf2/pr82718-2.c: New test.
--- /dev/null
+/* PR c++/83059 */
+/* { dg-do compile } */
+
+void
+foo (int *p, int *q, int *r)
+{
+ __atomic_compare_exchange (p, q, r, 0, 0, -1); /* { dg-warning "invalid memory model argument 6" } */
+ /* { dg-warning "unknown architecture specifi" "" { target *-*-* } .-1 } */
+ /* { dg-warning "failure memory model cannot be stronger than success memory model" "" { target *-*-* } .-2 } */
+}