PR middle-end/53790
* expr.c (expand_expr_real_1): Verify if the type is complete
before inspecting its size.
* gcc.dg/torture/pr53790.c: New testcase.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/gcc-4_7-branch@189047
138bc75d-0d04-0410-961f-
82ee72b054a4
+2012-06-28 Richard Guenther <rguenther@suse.de>
+
+ PR middle-end/53790
+ * expr.c (expand_expr_real_1): Verify if the type is complete
+ before inspecting its size.
+
2012-06-27 Nick Clifton <nickc@redhat.com>
* config/rx/rx.md (comparesi3_extend): Remove = modifier from
orig_op0 = op0
= expand_expr (tem,
(TREE_CODE (TREE_TYPE (tem)) == UNION_TYPE
+ && COMPLETE_TYPE_P (TREE_TYPE (tem))
&& (TREE_CODE (TYPE_SIZE (TREE_TYPE (tem)))
!= INTEGER_CST)
&& modifier != EXPAND_STACK_PARM
+2012-06-28 Richard Guenther <rguenther@suse.de>
+
+ PR middle-end/53790
+ * gcc.dg/torture/pr53790.c: New testcase.
+
2012-06-27 Fabien ChĂȘne <fabien@gcc.gnu.org>
PR c++/51214
--- /dev/null
+/* { dg-do compile } */
+
+typedef struct s {
+ int value;
+} s_t;
+
+static inline int
+read(s_t const *var)
+{
+ return var->value;
+}
+
+int main()
+{
+ extern union u extern_var;
+ return read((s_t *)&extern_var);
+}