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]

[RFA:] CPP: Correct (add) condition for calling debug_end_source_file


I used to be in the habit of adding -save-temps to
TARGET_LIBGCC2_CFLAGS in config/t-linux.  This now (since a/some weeks?)
crashes when bootstrapping (no configure parameters), compiling _muldi3 in
libgcc2.c for i686-pc-linux-gnulibc1, when the pre-processed file is read
in.  From my uninformed perspective, it seems the calls to
debug_end_source_file and debug_start_source_file are not matched; the
crash at least occurred because debug_end_source_file was called
without a matching debug_start_source_file call.  I added a matching
condition, and all is well.  I was unable to duplicate the error with a
separate test-case in short time.  Sorry for lack of deeper analysis; the
error will sooner or later come up somewhere else, but I thought better
sooner, especially since it's -save-temps related.

CPP hackers beware.
Ok to commit?

	* c-lex.c (cb_leave_file): Add condition to call of
 	debug_end_source_file to match condition for
	debug_start_source_file in cb_enter_file.

Index: c-lex.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/c-lex.c,v
retrieving revision 1.107
diff -p -c -r1.107 c-lex.c
*** c-lex.c	2000/11/02 08:05:44	1.107
--- c-lex.c	2000/11/06 14:07:25
*************** cb_leave_file (pfile)
*** 751,757 ****
      }
  #endif
    lex_lineno = CPP_BUFFER (pfile)->lineno;
!   debug_end_source_file (input_file_stack->line);
  
    update_header_times (input_file_stack->name);
    /* Hook for C++.  */
--- 751,758 ----
      }
  #endif
    lex_lineno = CPP_BUFFER (pfile)->lineno;
!   if (CPP_BUFFER (pfile)->prev)
!     debug_end_source_file (input_file_stack->line);
  
    update_header_times (input_file_stack->name);
    /* Hook for C++.  */

brgds, H-P


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