From 05fb348da54dfe5d665e375d9986b1e0f910b76b Mon Sep 17 00:00:00 2001 From: jsm28 Date: Thu, 31 Mar 2005 23:34:44 +0000 Subject: PR c/17855 * gimplify.c (gimplify_expr): Create a temporary for lvalue COND_EXPR and CALL_EXPR. testsuite: * gcc.c-torture/compile/struct-non-lval-1.c, gcc.c-torture/compile/struct-non-lval-2.c, gcc.c-torture/compile/struct-non-lval-3.c: New tests. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@97352 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/testsuite/gcc.c-torture/compile/struct-non-lval-3.c | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 gcc/testsuite/gcc.c-torture/compile/struct-non-lval-3.c (limited to 'gcc/testsuite/gcc.c-torture/compile/struct-non-lval-3.c') diff --git a/gcc/testsuite/gcc.c-torture/compile/struct-non-lval-3.c b/gcc/testsuite/gcc.c-torture/compile/struct-non-lval-3.c new file mode 100644 index 00000000000..3020194cae0 --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/struct-non-lval-3.c @@ -0,0 +1,7 @@ +/* Bug c/17855, using assignment for non-lvalue. */ +struct foo {char x, y, z[2];}; +struct foo p, q; +void bar(int baz) +{ + (p = q).z[baz] = 1; +} -- cgit v1.2.1