public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
* Re: c++/3782: [3.4 regression] -quiet -fstats produces a segmentation fault in cc1plus
@ 2003-04-26 13:06 Neil Booth
  0 siblings, 0 replies; 5+ messages in thread
From: Neil Booth @ 2003-04-26 13:06 UTC (permalink / raw)
  To: neil; +Cc: gcc-prs

The following reply was made to PR c++/3782; it has been noted by GNATS.

From: Neil Booth <neil@daikokuya.co.uk>
To: steven@gcc.gnu.org, Sylvain.Pion@sophia.inria.fr, gcc-bugs@gcc.gnu.org,
	gcc-gnats@gcc.gnu.org
Cc:  
Subject: Re: c++/3782: [3.4 regression] -quiet -fstats produces a segmentation fault in cc1plus
Date: Sat, 26 Apr 2003 14:04:02 +0100

 steven@gcc.gnu.org wrote:-
 
 > Synopsis: [3.4 regression] -quiet -fstats produces a segmentation fault in cc1plus
 > 
 > Responsible-Changed-From-To: unassigned->neil
 > Responsible-Changed-By: steven
 > Responsible-Changed-When: Wed Apr 23 06:40:21 2003
 > Responsible-Changed-Why:
 >     Neil broke this, so he agreed it's his to fix.
 > 
 > http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=3782
 
 Fixed with this.  I took the opportunity to reduce global variable
 usage.
 
 I'm going to follow up with some timevar.c improvements.
 
 Neil.
 
 	* flags.h (time_report): Remove.
 	* timevar.c (timevar_enable): New.
 	(TIMEVAR_ENABLE): Remove, use timevar_enable.
 	(timevar_init): Rename from init_timevar.
 	* timevar.h (timevar_init): Rename from init_timevar.
 	* toplev.c (time_report): Make static.
 	(process_options): Conditionally call timevar_init first.
 
 
 Index: flags.h
 ===================================================================
 RCS file: /cvs/gcc/gcc/gcc/flags.h,v
 retrieving revision 1.105
 diff -u -p -r1.105 flags.h
 --- flags.h	12 Apr 2003 02:16:45 -0000	1.105
 +++ flags.h	26 Apr 2003 13:03:09 -0000
 @@ -72,10 +72,6 @@ extern int optimize_size;
  
  extern int quiet_flag;
  
 -/* Print times taken by the various passes.  -ftime-report.  */
 -
 -extern int time_report;
 -
  /* Print memory still in use at end of compilation (which may have little
     to do with peak memory consumption).  -fmem-report.  */
  
 Index: timevar.c
 ===================================================================
 RCS file: /cvs/gcc/gcc/gcc/timevar.c,v
 retrieving revision 1.27
 diff -u -p -r1.27 timevar.c
 --- timevar.c	31 Jan 2003 07:33:56 -0000	1.27
 +++ timevar.c	26 Apr 2003 13:03:09 -0000
 @@ -113,10 +113,9 @@ static double clocks_to_msec;
  #include "flags.h"
  #include "timevar.h"
  
 -/* See timevar.h for an explanation of timing variables.  */
 +static bool timevar_enable;
  
 -/* This macro evaluates to nonzero if timing variables are enabled.  */
 -#define TIMEVAR_ENABLE (time_report)
 +/* See timevar.h for an explanation of timing variables.  */
  
  /* A timing variable.  */
  
 @@ -187,7 +186,7 @@ get_time (now)
    now->sys  = 0;
    now->wall = 0;
  
 -  if (!TIMEVAR_ENABLE)
 +  if (!timevar_enable)
      return;
  
    {
 @@ -225,10 +224,9 @@ timevar_accumulate (timer, start_time, s
  /* Initialize timing variables.  */
  
  void
 -init_timevar ()
 +timevar_init ()
  {
 -  if (!TIMEVAR_ENABLE)
 -    return;
 +  timevar_enable = true;
  
    /* Zero all elapsed times.  */
    memset ((void *) timevars, 0, sizeof (timevars));
 @@ -262,7 +260,7 @@ timevar_push (timevar)
    struct timevar_stack_def *context;
    struct timevar_time_def now;
  
 -  if (!TIMEVAR_ENABLE)
 +  if (!timevar_enable)
      return;
  
    /* Mark this timing variable as used.  */
 @@ -314,7 +312,7 @@ timevar_pop (timevar)
    struct timevar_time_def now;
    struct timevar_stack_def *popped = stack;
  
 -  if (!TIMEVAR_ENABLE)
 +  if (!timevar_enable)
      return;
  
    if (&timevars[timevar] != stack->timevar)
 @@ -353,7 +351,7 @@ timevar_start (timevar)
  {
    struct timevar_def *tv = &timevars[timevar];
  
 -  if (!TIMEVAR_ENABLE)
 +  if (!timevar_enable)
      return;
  
    /* Mark this timing variable as used.  */
 @@ -378,7 +376,7 @@ timevar_stop (timevar)
    struct timevar_def *tv = &timevars[timevar];
    struct timevar_time_def now;
  
 -  if (!TIMEVAR_ENABLE)
 +  if (!timevar_enable)
      return;
  
    /* TIMEVAR must have been started via timevar_start.  */
 @@ -430,7 +428,7 @@ timevar_print (fp)
    struct timevar_time_def *total = &timevars[TV_TOTAL].elapsed;
    struct timevar_time_def now;
  
 -  if (!TIMEVAR_ENABLE)
 +  if (!timevar_enable)
      return;
  
    /* Update timing information in case we're calling this from GDB.  */
 Index: timevar.h
 ===================================================================
 RCS file: /cvs/gcc/gcc/gcc/timevar.h,v
 retrieving revision 1.10
 diff -u -p -r1.10 timevar.h
 --- timevar.h	13 Feb 2003 04:57:17 -0000	1.10
 +++ timevar.h	26 Apr 2003 13:03:09 -0000
 @@ -79,7 +79,7 @@ timevar_id_t;
  /* Execute the sequence: timevar_pop (TV), return (E);  */
  #define POP_TIMEVAR_AND_RETURN(TV, E)  return (timevar_pop (TV), (E))
  
 -extern void init_timevar PARAMS ((void));
 +extern void timevar_init PARAMS ((void));
  extern void timevar_push PARAMS ((timevar_id_t));
  extern void timevar_pop PARAMS ((timevar_id_t));
  extern void timevar_start PARAMS ((timevar_id_t));
 Index: toplev.c
 ===================================================================
 RCS file: /cvs/gcc/gcc/gcc/toplev.c,v
 retrieving revision 1.745
 diff -u -p -r1.745 toplev.c
 --- toplev.c	26 Apr 2003 03:27:07 -0000	1.745
 +++ toplev.c	26 Apr 2003 13:03:12 -0000
 @@ -431,7 +431,7 @@ int quiet_flag = 0;
  
  /* Print times taken by the various passes.  -ftime-report.  */
  
 -int time_report = 0;
 +static int time_report = 0;
  
  /* Print memory still in use at end of compilation (which may have little
     to do with peak memory consumption).  -fmem-report.  */
 @@ -5214,6 +5214,11 @@ parse_options_and_default_flags (argc, a
  static void
  process_options ()
  {
 +  /* Initialize timing first.  The C front ends read the main file in
 +     the post_options hook, and C++ does file timings.  */
 +  if (time_report || !quiet_flag  || flag_detailed_statistics)
 +    timevar_init ();
 +
    /* Allow the front end to perform consistency checks and do further
       initialization based on the command line options.  This hook also
       sets the original filename if appropriate (e.g. foo.i -> foo.c)
 @@ -5326,9 +5331,6 @@ process_options ()
  	print_switch_values (stderr, 0, MAX_LINE, "", " ", "\n");
      }
  
 -  if (! quiet_flag  || flag_detailed_statistics)
 -    time_report = 1;
 -
    if (flag_syntax_only)
      {
        write_symbols = NO_DEBUG;
 @@ -5562,9 +5564,6 @@ finalize ()
  static void
  do_compile ()
  {
 -  /* We cannot start timing until after options are processed since that
 -     says if we run timers or not.  */
 -  init_timevar ();
    timevar_start (TV_TOTAL);
  
    /* Set up the back-end if requested.  */


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: c++/3782: [3.4 regression] -quiet -fstats produces a segmentation fault in cc1plus
@ 2003-04-29  7:10 steven
  0 siblings, 0 replies; 5+ messages in thread
From: steven @ 2003-04-29  7:10 UTC (permalink / raw)
  To: Sylvain.Pion, gcc-bugs, gcc-prs, neil

Synopsis: [3.4 regression] -quiet -fstats produces a segmentation fault in cc1plus

State-Changed-From-To: analyzed->closed
State-Changed-By: steven
State-Changed-When: Tue Apr 29 07:10:56 2003
State-Changed-Why:
    fixed

http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=3782


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: c++/3782: [3.4 regression] -quiet -fstats produces a segmentation fault in cc1plus
@ 2003-04-23  6:40 steven
  0 siblings, 0 replies; 5+ messages in thread
From: steven @ 2003-04-23  6:40 UTC (permalink / raw)
  To: Sylvain.Pion, gcc-bugs, gcc-prs, neil, nobody

Synopsis: [3.4 regression] -quiet -fstats produces a segmentation fault in cc1plus

Responsible-Changed-From-To: unassigned->neil
Responsible-Changed-By: steven
Responsible-Changed-When: Wed Apr 23 06:40:21 2003
Responsible-Changed-Why:
    Neil broke this, so he agreed it's his to fix.

http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=3782


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: c++/3782: [3.4 regression] -quiet -fstats produces a segmentation fault in cc1plus
@ 2003-04-16 20:07 ehrhardt
  0 siblings, 0 replies; 5+ messages in thread
From: ehrhardt @ 2003-04-16 20:07 UTC (permalink / raw)
  To: Sylvain.Pion, gcc-bugs, gcc-prs, nobody

Synopsis: [3.4 regression] -quiet -fstats produces a segmentation fault in cc1plus

State-Changed-From-To: open->analyzed
State-Changed-By: cae
State-Changed-When: Wed Apr 16 20:07:20 2003
State-Changed-Why:
    This PR is the cc1plus crash with -fstats. It now crashes due to a call
    to get_run_time in init_c_lex before timevar is initialized.
    
    Neil moved the call to init_c_lex from c_common_init to c_common_init to
    c_common_post_options with this patch:
    
    2003-03-08  Neil Booth  <neil@daikokuya.co.uk>
    
            * c-common.h (c_common_init, c_common_post_options): Update.
            * c-objc-common.c (c_objc_common_init): Update for new prototype.
            * c-opts.c (saved_lineno): New.
            (c_common_post_options, c_common_init): Update prototypes,
            move call to cpp_read_main_file from latter to former.
    
    Unfortunately c_common_post_options is called before timevar_init.
    
       regards  Christian
    

http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=3782


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: c++/3782: [3.4 regression] -quiet -fstats produces a segmentation fault in cc1plus
@ 2003-03-10 14:24 reichelt
  0 siblings, 0 replies; 5+ messages in thread
From: reichelt @ 2003-03-10 14:24 UTC (permalink / raw)
  To: Sylvain.Pion, gcc-bugs, gcc-prs, nobody

Old Synopsis: [3.2/3.3/3.4 regression] -quiet -fstats produces a segmentation fault in cc1plus
New Synopsis: [3.4 regression] -quiet -fstats produces a segmentation fault in cc1plus

State-Changed-From-To: closed->open
State-Changed-By: reichelt
State-Changed-When: Mon Mar 10 14:24:43 2003
State-Changed-Why:
    Crashes again on mainline (as of 20030310) :(

http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=3782


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2003-04-29  7:10 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-04-26 13:06 c++/3782: [3.4 regression] -quiet -fstats produces a segmentation fault in cc1plus Neil Booth
  -- strict thread matches above, loose matches on Subject: below --
2003-04-29  7:10 steven
2003-04-23  6:40 steven
2003-04-16 20:07 ehrhardt
2003-03-10 14:24 reichelt

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).