Bug 4252 - cc1: Invalid option `-fdump-translation-unit'
Summary: cc1: Invalid option `-fdump-translation-unit'
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: debug (show other bugs)
Version: 3.0.1
: P3 normal
Target Milestone: 3.3.1
Assignee: Not yet assigned to anyone
URL:
Keywords: documentation
Depends on:
Blocks:
 
Reported: 2001-09-06 12:46 UTC by dm-nws
Modified: 2003-06-18 06:01 UTC (History)
5 users (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed: 2003-05-27 14:34:24


Attachments
Proposed patch to mainline. (441 bytes, patch)
2003-06-17 18:58 UTC, Bob Abeles
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description dm-nws 2001-09-06 12:46:00 UTC
The command line options
-fdump-translation-unit
-fdump-class-hierarchy
don't seem to work.

However they are documented in both the Info and man pages.
Also, said documentation alludes to -fdump-tree, but -fdump-tree neither works nor seems to be documented.

Release:
gcc 3.0.1

Environment:
Debian Woody

How-To-Repeat:
% touch /tmp/foo.c
% gcc -c -fdump-translation-unit /tmp/foo.c
cc1: Invalid option `-fdump-translation-unit'
%
Comment 1 Craig Rodrigues 2001-10-21 01:11:01 UTC
From: Craig Rodrigues <rodrigc@mediaone.net>
To: gcc-patches@gcc.gnu.org
Cc: gcc-gnats@gcc.gnu.org, rodrigc@gcc.gnu.org, gerald@gcc.gnu.org
Subject: Re: debug/4252 cc1: Invalid option `-fdump-translation-unit'
Date: Sun, 21 Oct 2001 01:11:01 -0400

 http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view&pr=4252&database=gcc
 
 -fdump-translation-unit has been removed from gcc, so it should
 be removed from the documentation as well.
 
 
 2001-10-21  Craig Rodrigues  <rodrigc@gcc.gnu.org>
 
 	PR debug/4252
 	* doc/invoke.texi: Remove references to -fdump-translation-unit
 
 
 
 Index: invoke.texi
 ===================================================================
 RCS file: /cvs/gcc/gcc/gcc/doc/invoke.texi,v
 retrieving revision 1.3.2.28
 diff -u -r1.3.2.28 invoke.texi
 --- invoke.texi	2001/10/17 09:06:44	1.3.2.28
 +++ invoke.texi	2001/10/21 05:08:18
 @@ -237,7 +237,7 @@
  @xref{Debugging Options,,Options for Debugging Your Program or GCC}.
  @gccoptlist{
  -a  -ax  -d@var{letters}  -dumpspecs  -dumpmachine  -dumpversion @gol
 --fdump-unnumbered -fdump-translation-unit@r{[}-@var{n}@r{]} @gol
 +-fdump-unnumbered 
  -fdump-class-hierarchy@r{[}-@var{n}@r{]} @gol
  -fdump-ast-original@r{[}-@var{n}@r{]} -fdump-ast-optimized@r{[}-@var{n}@r{]} @gol
  -fmem-report  -fpretend-float @gol
 @@ -2958,14 +2958,6 @@
  numbers and line number note output.  This makes it more feasible to
  use diff on debugging dumps for compiler invocations with different
  options, in particular with and without @option{-g}.
 -
 -@item -fdump-translation-unit @r{(C and C++ only)}
 -@itemx -fdump-translation-unit-@var{number} @r{(C and C++ only)}
 -@opindex fdump-translation-unit
 -Dump a representation of the tree structure for the entire translation
 -unit to a file.  The file name is made by appending @file{.tu} to the
 -source file name.  If the @samp{-@var{number}} form is used, @var{number}
 -controls the details of the dump as described for the @option{-fdump-tree} options.
  
  @item -fdump-class-hierarchy @r{(C++ only)}
  @itemx -fdump-class-hierarchy-@var{number} @r{(C++ only)}
 
 
 -- 
 Craig Rodrigues        
 http://www.gis.net/~craigr    
 rodrigc@mediaone.net          

Comment 2 Gerald Pfeifer 2001-10-22 07:42:24 UTC
From: gerald@gcc.gnu.org
To: gcc-gnats@gcc.gnu.org
Cc:  
Subject: debug/4252
Date: 22 Oct 2001 07:42:24 -0000

 CVSROOT:	/cvs/gcc
 Module name:	gcc
 Changes by:	gerald@gcc.gnu.org	2001-10-22 00:42:23
 
 Modified files:
 	gcc            : ChangeLog 
 	gcc/doc        : invoke.texi 
 
 Log message:
 	PR debug/4252
 	* doc/invoke.texi: Remove references to -fdump-translation-unit.
 
 Patches:
 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ChangeLog.diff?cvsroot=gcc&r1=1.11615&r2=1.11616
 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/doc/invoke.texi.diff?cvsroot=gcc&r1=1.64&r2=1.65
 

Comment 3 Gerald Pfeifer 2001-10-22 09:42:18 UTC
From: Gerald Pfeifer <pfeifer@dbai.tuwien.ac.at>
To: Craig Rodrigues <rodrigc@mediaone.net>
Cc: <gcc-patches@gcc.gnu.org>, <gcc-gnats@gcc.gnu.org>,
   Nathan Sidwell <nathan@codesourcery.com>
Subject: Re: debug/4252 cc1: Invalid option `-fdump-translation-unit'
Date: Mon, 22 Oct 2001 09:42:18 +0200 (CEST)

 On Sun, 21 Oct 2001, Craig Rodrigues wrote:
 > http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view&pr=4252&database=gcc
 >
 > -fdump-translation-unit has been removed from gcc, so it should
 > be removed from the documentation as well.
 
 It seems Nathan missed that when removing said flag with:
 
   2001-06-05  Nathan Sidwell  <nathan@codesourcery.com>
 
         * c-common.h (flag_dump_translation_unit): Remove.
         (enum tree_dump_index): Define.
         (TDF_ADDRESS, TDF_SLIM): New #defines.
         (dump_node_to_file): Remove.
         (dump_node): Make extern. Add flags.
         (dump_flag, dump_enabled_p, dump_begin, dump_end,
         dump_switch_p): Prototype.
         * c-common.c (flag_dump_translation_unit): Remove.
         * c-decl.c (c_decode_option): Remove -fdump-translation-unit
         logic. Use dump_switch_p.
         * c-dump.h (struct dump_info): Add node and user fields.
         (dump_pointer): Declare.
         * c-dump.c (dump_node): Make extern. Add flags.
         (SOL_COLUMN, EOL_COLUMN, COLUMN_ALIGNMENT): New #defines.
         (dump_new_line, dump_maybe_newline): Use them.
         (dump_pointer): New function.
         (dequeue_and_dump): Check TDF_SLIM before dumping a _DECL's
         chain or function's body. Dump address, if TDF_ADDRESS set.
         (dump_flag): Define.
         (dump_node_to_file): Remove.
         (struct dump_file_info): New struct.
         (dump_files): New array.
         (dump_begin, dump_end, dump_enabled_p, dump_switch_p): Define.
         * c-lang.c (finish_file): Adjust dumping.
         * toplev.h (dump_base_name): Make extern.
         * invoke.texi: Document new flags.
 
 > 2001-10-21  Craig Rodrigues  <rodrigc@gcc.gnu.org>
 >
 > 	PR debug/4252
 > 	* doc/invoke.texi: Remove references to -fdump-translation-unit
 
 Installed, thanks.  (I added a full-stop at the end of the ChangeLog
 entry.)
 
 Gerald
 -- 
 Gerald "Jerry" pfeifer@dbai.tuwien.ac.at http://www.dbai.tuwien.ac.at/~pfeifer/
 
 
 

Comment 4 Craig Rodrigues 2001-10-22 19:05:39 UTC
From: Craig Rodrigues <rodrigc@mediaone.net>
To: gcc-patches@gcc.gnu.org
Cc: gcc-gnats@gcc.gnu.org, gerald@gcc.gnu.org
Subject: Re: debug/4252 remove reference to -fdump-tree
Date: Mon, 22 Oct 2001 19:05:39 -0400

 Hi,
 
 This addresses another point brought up in PR 4252.
 The -fdump-tree option does not seem to exist.
 
 2001-10-17  Craig Rodrigues  <rodrigc@gcc.gnu.org>
 
 	PR debug/4252
 	* doc/invoke.texi: Remove reference to -fdump-tree.
 
 
 Index: invoke.texi
 ===================================================================
 RCS file: /cvs/gcc/gcc/gcc/doc/invoke.texi,v
 retrieving revision 1.3.2.28
 diff -u -r1.3.2.28 invoke.texi
 --- invoke.texi	2001/10/17 09:06:44	1.3.2.28
 +++ invoke.texi	2001/10/22 23:01:07
 @@ -2965,7 +2965,7 @@
  Dump a representation of the tree structure for the entire translation
  unit to a file.  The file name is made by appending @file{.tu} to the
  source file name.  If the @samp{-@var{number}} form is used, @var{number}
 -controls the details of the dump as described for the @option{-fdump-tree} options.
 +controls the details of the dump.
  
  @item -fdump-class-hierarchy @r{(C++ only)}
  @itemx -fdump-class-hierarchy-@var{number} @r{(C++ only)}
 @@ -2973,8 +2973,8 @@
  Dump a representation of each class's hierarchy and virtual function
  table layout to a file.  The file name is made by appending @file{.class}
  to the source file name.  If the @samp{-@var{number}} form is used, @var{number}
 -controls the details of the dump as described for the @option{-fdump-tree}
 -options.
 +controls the details of the dump. 
 +
  
  @item -fdump-ast-@var{switch} @r{(C++ only)}
  @itemx -fdump-ast-@var{switch}-@var{number} @r{(C++ only)}
 
 
 -- 
 Craig Rodrigues        
 http://www.gis.net/~craigr    
 rodrigc@mediaone.net          

Comment 5 Gerald Pfeifer 2001-10-24 15:10:21 UTC
From: Gerald Pfeifer <pfeifer@dbai.tuwien.ac.at>
To: Craig Rodrigues <rodrigc@mediaone.net>
Cc: <gcc-patches@gcc.gnu.org>, <gcc-gnats@gcc.gnu.org>, <gerald@gcc.gnu.org>
Subject: Re: debug/4252 remove reference to -fdump-tree
Date: Wed, 24 Oct 2001 15:10:21 +0200 (CEST)

 On Mon, 22 Oct 2001, Craig Rodrigues wrote:
 > 2001-10-17  Craig Rodrigues  <rodrigc@gcc.gnu.org>
 >
 > 	PR debug/4252
 > 	* doc/invoke.texi: Remove reference to -fdump-tree.
 
 That patch doesn't apply cleanly against my currently checked out tree,
 and even if I manually fix one of the two parts, the second doesn't seem
 to exist.
 
 To make sure that I don't botch anything with my manual adjustments, would
 you mind updating your CVS tree and adjusting the patch?
 
 (If you have CVS write access, the updated patch is approved. If you
 have not, we probably should arrange for full CVS write access -- see
 http://gcc.gnu.org/cvswrite.html for details.)
 
 Thanks,
 Gerald
 -- 
 Gerald "Jerry" pfeifer@dbai.tuwien.ac.at http://www.dbai.tuwien.ac.at/~pfeifer/
Comment 6 Eric Weddington 2003-05-23 23:37:22 UTC
Everything up to Comment #4 is resolved, and then in Comment #4 Craig Rodrigues 
states:
"The -fdump-tree option does not seem to exist."

This is in reference to the description of -fdump-class-hierarchy-options in 
Debugging Options in the manual 
<http://gcc.gnu.org/onlinedocs/gcc-3.3/gcc/Debugging-Options.html#Debugging%20Op
tions>
where the description states:

-fdump-class-hierarchy-options (C++ only) 
     Dump a representation of each class's hierarchy and virtual function table 
layout to a file. The file name is made by appending .class to the source file 
name. If the -options form is used, options controls the details of the dump as 
described for the -fdump-tree options. 

So, in context, the description is not referring to a non-existent -fdump-tree 
switch. It is referring to the -fdump-tree-switch-options description right 
below it in the manual.

Craig's patch in Comment #4 is probably not needed, then. Unless further 
clarification in the manual is deemed necessary.

If it is not necessary, then this bug can probably be set to RESOLVED.

Eric Weddington
Comment 7 Dara Hazeghi 2003-05-27 05:00:02 UTC
Hello,

this problem is still present in the gcc 3.3 and mainline docs (see http://gcc.gnu.org/onlinedocs/
gcc/Debugging-Options.html#Debugging%20Options for instance) . Would some kind soul like to 
make a patch for this? Otherwise it looks like it'll get forgotten again...

Dara
Comment 8 Andrew Pinski 2003-05-27 14:34:24 UTC
See Dara's comment, we really need a document component and I mark this as 
something that should be done by 3.3.1 because it seems like the document is still wrong 
and it is a  regression from when the documentation was changed.
Comment 9 Bob Abeles 2003-06-17 18:41:10 UTC
I ran into this bug (cc1: Invalid option '-fdump-translation-unit') on the 3.4
mainline, and then found this problem report in Bugzilla. Reviewing the patch
"2001-06-05  Nathan Sidwell", I see that Nathan did not remove the
-fdump-translation-unit command-line flag; instead, he changed the way that the
'-fdump'-prefixed options were handled, removing an obsolete internal flag named
flag_dump_translation_unit. A subsequent misreading of this comment has spawned
the confusion over whether the command-line flag should be removed from the
documentation. My conclusion is that the documentation is correct, and that
there is a genuine bug that prevents the -fdump-translation-unit command-line
flag from working. I have a proposed patch to the mainline which fixes this bug;
I will attach it shortly.

  
Comment 10 Bob Abeles 2003-06-17 18:58:21 UTC
Created attachment 4237 [details]
Proposed patch to mainline.
Comment 11 Neil Booth 2003-06-18 06:01:18 UTC
Should be fixed by Robert Abeles' patch.