aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-nrv.c
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2008-04-16 18:01:57 +0200
committerJakub Jelinek <jakub@gcc.gnu.org>2008-04-16 18:01:57 +0200
commit12e19e0588445040f55e4299a69904afd0cd1b22 (patch)
treeeb8633e764cac5e80e5b5885d5b624e8fbfb7c0e /gcc/tree-nrv.c
parent3d5e00a036cec0a70c46c0f2617de26849c7d46b (diff)
downloadgcc-12e19e0588445040f55e4299a69904afd0cd1b22.zip
gcc-12e19e0588445040f55e4299a69904afd0cd1b22.tar.gz
gcc-12e19e0588445040f55e4299a69904afd0cd1b22.tar.bz2
re PR c/35739 (ICE with _Decimal128 and va_list)
PR c/35739 * tree-nrv.c (tree_nrv): Don't optimize if result_type is GIMPLE reg type. * gcc.dg/dfp/pr35739.c: New test. From-SVN: r134351
Diffstat (limited to 'gcc/tree-nrv.c')
-rw-r--r--gcc/tree-nrv.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/gcc/tree-nrv.c b/gcc/tree-nrv.c
index 7330d28..35928ea 100644
--- a/gcc/tree-nrv.c
+++ b/gcc/tree-nrv.c
@@ -1,5 +1,5 @@
/* Language independent return value optimizations
- Copyright (C) 2004, 2005, 2007 Free Software Foundation, Inc.
+ Copyright (C) 2004, 2005, 2007, 2008 Free Software Foundation, Inc.
This file is part of GCC.
@@ -115,6 +115,11 @@ tree_nrv (void)
if (!aggregate_value_p (result, current_function_decl))
return 0;
+ /* If a GIMPLE type is returned in memory, finalize_nrv_r might create
+ non-GIMPLE. */
+ if (is_gimple_reg_type (result_type))
+ return 0;
+
/* Look through each block for assignments to the RESULT_DECL. */
FOR_EACH_BB (bb)
{