This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Patch for c/5105


"Joseph S. Myers" <jsm28@cam.ac.uk> writes:

> This patch fixes PR c/5105, where the initializer of a compound
> literal wasn't being properly walked in tree inlining.
>
> Bootstrapped with no regressions on i686-pc-linux-gnu.  Applied to
> mainline.
>
> 2001-12-17  Joseph S. Myers  <jsm28@cam.ac.uk>
>
> 	* c-common.def (COMPOUND_LITERAL_EXPR): Contain a DECL_STMT, not
> 	a DECL directly.
> 	* c-common.h (COMPOUND_LITERAL_EXPR_DECL_STMT): New.
> 	(COMPOUND_LITERAL_EXPR_DECL): Adjust definition.
> 	* c-decl.c (build_compound_literal): Put the decl inside a
> 	DECL_STMT.
> 	* doc/c-tree.texi (COMPOUND_LITERAL_EXPR): Update documentation.
> 	Fixes PR c/5105.
>
> testsuite:
> 2001-12-17  Joseph S. Myers  <jsm28@cam.ac.uk>
>
> 	* gcc.c-torture/compile/20011217-1.c: New test.
>
> diff -rupN gcc.orig/c-common.def gcc/c-common.def
> --- gcc.orig/c-common.def	Tue Dec  4 22:50:11 2001
> +++ gcc/c-common.def	Sun Dec 16 21:30:45 2001
> @@ -103,7 +103,8 @@ DEFTREECODE (CASE_LABEL, "case_label", '
>  DEFTREECODE (STMT_EXPR, "stmt_expr", 'e', 1)
>  
>  /* A COMPOUND_LITERAL_EXPR represents a C99 compound literal.  The
> -   COMPOND_LITERAL_EXPR_DECL is the decl for the anonymous object
> -   represented by the COMPOUND_LITERAL; the DECL_INITIAL of that
> -   decl is the CONSTRUCTOR that initializes the compound literal.  */
> +   COMPOND_LITERAL_EXPR_DECL_STMT is the a DECL_STMT containing the decl

COMPOUND - there's a U missing.  I'll commit the following patch now
as obvious.

Andreas

2001-12-17  Andreas Jaeger  <aj@suse.de>

	* c-common.def: Fix typo in comment.

============================================================
Index: gcc/c-common.def
--- gcc/c-common.def	2001/12/17 01:18:38	1.7
+++ gcc/c-common.def	2001/12/17 08:21:01
@@ -2,7 +2,7 @@
    additional tree codes used in the GNU C++ compiler (see tree.def
    for the standard codes).
    Copyright (C) 1987, 1988, 1990, 1993, 1997, 1998,
-   1999, 2000 Free Software Foundation, Inc.
+   1999, 2000, 2001 Free Software Foundation, Inc.
    Written by Benjamin Chelf <chelf@codesourcery.com>
 
 This file is part of GCC.
@@ -103,7 +103,7 @@ DEFTREECODE (CASE_LABEL, "case_label", '
 DEFTREECODE (STMT_EXPR, "stmt_expr", 'e', 1)
 
 /* A COMPOUND_LITERAL_EXPR represents a C99 compound literal.  The
-   COMPOND_LITERAL_EXPR_DECL_STMT is the a DECL_STMT containing the decl
+   COMPOUND_LITERAL_EXPR_DECL_STMT is the a DECL_STMT containing the decl
    for the anonymous object represented by the COMPOUND_LITERAL;
    the DECL_INITIAL of that decl is the CONSTRUCTOR that initializes
    the compound literal.  */

-- 
 Andreas Jaeger
  SuSE Labs aj@suse.de
   private aj@arthur.inka.de
    http://www.suse.de/~aj


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]