* c-common.c (get_atomic_generic_size): Don't segfault if the
type doesn't have a size.
* c-c++-common/pr61553.c: New test.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@211905
138bc75d-0d04-0410-961f-
82ee72b054a4
+2014-06-23 Marek Polacek <polacek@redhat.com>
+ Andrew MacLeod <amacleod@redhat.com>
+
+ PR c/61553
+ * c-common.c (get_atomic_generic_size): Don't segfault if the
+ type doesn't have a size.
+
2014-06-20 Marek Polacek <polacek@redhat.com>
* c-gimplify.c: Include "c-ubsan.h" and "pointer-set.h".
function);
return 0;
}
- size = tree_to_uhwi (TYPE_SIZE_UNIT (TREE_TYPE (type)));
+ tree type_size = TYPE_SIZE_UNIT (TREE_TYPE (type));
+ size = type_size ? tree_to_uhwi (type_size) : 0;
if (size != size_0)
{
error_at (loc, "size mismatch in argument %d of %qE", x + 1,
+2014-06-23 Marek Polacek <polacek@redhat.com>
+
+ PR c/61553
+ * c-c++-common/pr61553.c: New test.
+
2014-06-23 Richard Biener <rguenther@suse.de>
* g++.dg/vect/slp-pr50413.cc: Scan and cleanup appropriate SLP dumps.
--- /dev/null
+/* PR c/61553 */
+/* { dg-do compile } */
+
+void
+foo (char *s)
+{
+ __atomic_store (s, (void *) 0, __ATOMIC_SEQ_CST);
+}