From ac97d816a6cbc700f4808223e21d6bdb50e4dd66 Mon Sep 17 00:00:00 2001 From: Uros Bizjak Date: Tue, 8 May 2007 08:48:15 +0200 Subject: [PATCH] re PR target/31854 (internal compiler error: in cgraph_local_info, at cgraph.c:618) PR target/31854 * config/i386/i386.c (ix86_function_regparm): Process local functions only when TREE_CODE (decl) equals FUNCTION_DECL. From-SVN: r124538 --- gcc/ChangeLog | 6 ++++++ gcc/config/i386/i386.c | 3 ++- gcc/testsuite/ChangeLog | 9 +++++++-- gcc/testsuite/gcc.target/i386/pr31854.c | 10 ++++++++++ 4 files changed, 25 insertions(+), 3 deletions(-) create mode 100644 gcc/testsuite/gcc.target/i386/pr31854.c diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 22b09d4fc5f..a53783538ee 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2007-05-08 Uros Bizjak + + PR target/31854 + * config/i386/i386.c (ix86_function_regparm): Process local + functions only when TREE_CODE (decl) equals FUNCTION_DECL. + 2007-05-07 Mike Stump * doc/invoke.texi (Warning Options): Document that -Wempty-body diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c index a3936546d7b..7e2accf4625 100644 --- a/gcc/config/i386/i386.c +++ b/gcc/config/i386/i386.c @@ -2792,7 +2792,8 @@ ix86_function_regparm (tree type, tree decl) return 2; /* Use register calling convention for local functions when possible. */ - if (decl && flag_unit_at_a_time && !profile_flag) + if (decl && TREE_CODE (decl) == FUNCTION_DECL + && flag_unit_at_a_time && !profile_flag) { struct cgraph_local_info *i = cgraph_local_info (decl); if (i && i->local) diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 894e2ca44d7..6ba856d9868 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2007-05-08 Uros Bizjak + + PR target/31854 + * gcc.target/i386/pr31854.c: New test. + 2007-05-07 Janis Johnson * gcc.dg/pch/pch.exp: XFAIL largefile on Solaris 10 x86. @@ -12,8 +17,8 @@ 2007-05-07 Uros Bizjak - * gcc.dg/dfp/convert-bfp-fold.c: Remove extra assignment to - sf variable. Rearrange conversions from binary float to decimal float. + * gcc.dg/dfp/convert-bfp-fold.c: Remove extra assignment to 'sf' + variable. Rearrange conversions from binary float to decimal float. 2007-05-07 Mark Mitchell diff --git a/gcc/testsuite/gcc.target/i386/pr31854.c b/gcc/testsuite/gcc.target/i386/pr31854.c new file mode 100644 index 00000000000..d5dca57ea63 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/pr31854.c @@ -0,0 +1,10 @@ +/* { dg-do compile { target dfp } } */ +/* { dg-options "-O -std=gnu99" } */ + +_Decimal128 d128; +long double tf; + +void foo (void) +{ + d128 = tf; +} -- 2.30.2