From: Jakub Jelinek Date: Sat, 9 Apr 2005 17:09:49 +0000 (+0200) Subject: re PR target/20795 (ICE in assign_parms) X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=1b80335583a3b3713ed66afbc48d6ba886ce514c;p=platform%2Fupstream%2Fgcc.git re PR target/20795 (ICE in assign_parms) PR target/20795 * config/i386/i386.c (construct_container): Pass empty aligned struct, union or class in memory. * g++.dg/abi/param2.C: New test. From-SVN: r97912 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 1211bc9..937b958 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2005-04-09 Jakub Jelinek + + PR target/20795 + * config/i386/i386.c (construct_container): Pass empty aligned + struct, union or class in memory. + 2005-04-09 Kazu Hirata * dominance.c, gthr-win32.h, reg-stack.c, tree-ssa-copy.c, diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c index e762fa7..427bfee 100644 --- a/gcc/config/i386/i386.c +++ b/gcc/config/i386/i386.c @@ -2682,6 +2682,11 @@ construct_container (enum machine_mode mode, enum machine_mode orig_mode, abort (); } } + + /* Empty aligned struct, union or class. */ + if (nexps == 0) + return NULL; + ret = gen_rtx_PARALLEL (mode, rtvec_alloc (nexps)); for (i = 0; i < nexps; i++) XVECEXP (ret, 0, i) = exp [i]; diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 14258a1..3654a7b 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2005-04-09 Jakub Jelinek + + PR target/20795 + * g++.dg/abi/param2.C: New test. + 2005-04-09 Uros Bizjak * gcc.dg/builtins-53.c: New test. diff --git a/gcc/testsuite/g++.dg/abi/param2.C b/gcc/testsuite/g++.dg/abi/param2.C new file mode 100644 index 0000000..ed3c0df --- /dev/null +++ b/gcc/testsuite/g++.dg/abi/param2.C @@ -0,0 +1,18 @@ +// PR target/20795 +// Test passing aligned empty aggregate +// { dg-do compile } + +struct S { union {} a; } __attribute__((aligned)); + +S +foo (S arg) +{ + return arg; +} + +void +bar (void) +{ + S arg; + foo (arg); +}