diff options
author | Joseph Myers <joseph@codesourcery.com> | 2010-01-12 23:09:00 +0000 |
---|---|---|
committer | Joseph Myers <jsm28@gcc.gnu.org> | 2010-01-12 23:09:00 +0000 |
commit | e616f54d28182c80f9bfe10174a2a04befae62df (patch) | |
tree | 0e828be7f6462d1d72db441234272fd4b9656e59 /gcc/testsuite/gcc.c-torture/compile/pr42708-1.c | |
parent | b4ab701fcc8933f69f288ca434d3376026d23cc0 (diff) | |
download | gcc-e616f54d28182c80f9bfe10174a2a04befae62df.zip gcc-e616f54d28182c80f9bfe10174a2a04befae62df.tar.gz gcc-e616f54d28182c80f9bfe10174a2a04befae62df.tar.bz2 |
re PR c/42708 (ICE in gimplify_expr, at gimplify.c:6993)
PR c/42708
* c-typeck.c (build_c_cast): Fold value cast to union type before
wrapping it in a CONSTRUCTOR.
testsuite:
* gcc.c-torture/compile/pr42708-1.c: New test.
From-SVN: r155846
Diffstat (limited to 'gcc/testsuite/gcc.c-torture/compile/pr42708-1.c')
-rw-r--r-- | gcc/testsuite/gcc.c-torture/compile/pr42708-1.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.c-torture/compile/pr42708-1.c b/gcc/testsuite/gcc.c-torture/compile/pr42708-1.c new file mode 100644 index 0000000..9124a85 --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/pr42708-1.c @@ -0,0 +1,10 @@ +typedef __SIZE_TYPE__ size_t; +void *malloc(size_t); +typedef union YYSTYPE { + char *id; +} YYSTYPE; +extern YYSTYPE yylval; +void yylex (int b) +{ + yylval = (YYSTYPE) (b ? 0 : (char *) malloc (4)); +} |