diff options
author | Uros Bizjak <uros@gcc.gnu.org> | 2005-11-09 07:30:03 +0100 |
---|---|---|
committer | Uros Bizjak <uros@gcc.gnu.org> | 2005-11-09 07:30:03 +0100 |
commit | 456b8ce5dbc2f77b3506d18c7eaec25cf76cb573 (patch) | |
tree | b078bd18fbfd08b7038db568253cd7312a08964d /gcc | |
parent | 85e77c2176355b95565534e4bee77eb5672ccfe9 (diff) | |
download | gcc-456b8ce5dbc2f77b3506d18c7eaec25cf76cb573.zip gcc-456b8ce5dbc2f77b3506d18c7eaec25cf76cb573.tar.gz gcc-456b8ce5dbc2f77b3506d18c7eaec25cf76cb573.tar.bz2 |
re PR c/24101 (Segfault with preprocessed source)
libcpp/
PR c/24101
* init.c (read_original_filename): Temporarily set
state.in_directive before calling _cpp_lex_direct for
CPP_HASH tokens.
gcc/
PR c/24101
* toplev.c (process_options): Initialize debug_hooks early
in case lang_hooks.post_options ends up calling a debug_hook.
gcc/testsuite/
PR c/24101
* gcc.dg/pr24101-1.i, gcc.dg/pr24101-2.i: New tests.
* gcc.dg/dg.exp: Run main loop also for *.i files.
From-SVN: r106677
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 7 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/dg.exp | 2 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/pr24101-1.i | 4 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/pr24101-2.i | 4 | ||||
-rw-r--r-- | gcc/toplev.c | 5 |
6 files changed, 26 insertions, 2 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 5e86d19..c983631 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,10 @@ +2005-11-09 Per Bothner <per@bothner.com> + Uros Bizjak <uros@kss-loka.si> + + PR c/24101 + * toplev.c (process_options): Initialize debug_hooks early + in case lang_hooks.post_options ends up calling a debug_hook. + 2005-11-08 Jakub Jelinek <jakub@redhat.com> * dwarf2out.c (multiple_reg_loc_descriptor): Don't assume diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 8058bb8..d0bd89e 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,9 @@ +2005-11-09 Uros Bizjak <uros@kss-loka.si> + + PR c/24101 + * gcc.dg/pr24101-1.i, gcc.dg/pr24101-2.i: New tests. + * gcc.dg/dg.exp: Run main loop also for *.i files. + 2005-11-08 Jakub Jelinek <jakub@redhat.com> PR c++/19450 diff --git a/gcc/testsuite/gcc.dg/dg.exp b/gcc/testsuite/gcc.dg/dg.exp index 00b26d6..826bcf3 100644 --- a/gcc/testsuite/gcc.dg/dg.exp +++ b/gcc/testsuite/gcc.dg/dg.exp @@ -29,7 +29,7 @@ if ![info exists DEFAULT_CFLAGS] then { dg-init # Main loop. -dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/*.\[cS\]]] \ +dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/*.\[cSi\]]] \ "" $DEFAULT_CFLAGS # All done. diff --git a/gcc/testsuite/gcc.dg/pr24101-1.i b/gcc/testsuite/gcc.dg/pr24101-1.i new file mode 100644 index 0000000..45c1655 --- /dev/null +++ b/gcc/testsuite/gcc.dg/pr24101-1.i @@ -0,0 +1,4 @@ +/* { dg-do compile } */ +/* { dg-options "-ansi" } */ + +# 1 "/usr/local/lib/gcc/i686-pc-linux-gnu/4.1.0/include/stddef.h" 1 3 4 diff --git a/gcc/testsuite/gcc.dg/pr24101-2.i b/gcc/testsuite/gcc.dg/pr24101-2.i new file mode 100644 index 0000000..501382d --- /dev/null +++ b/gcc/testsuite/gcc.dg/pr24101-2.i @@ -0,0 +1,4 @@ +/* { dg-do compile } */ +/* { dg-options "-ansi" } */ + +# diff --git a/gcc/toplev.c b/gcc/toplev.c index eea9ab2..b03e91d 100644 --- a/gcc/toplev.c +++ b/gcc/toplev.c @@ -1493,6 +1493,10 @@ general_init (const char *argv0) static void process_options (void) { + /* Just in case lang_hooks.post_options ends up calling a debug_hook. + This can happen with incorrect pre-processed input. */ + debug_hooks = &do_nothing_debug_hooks; + /* 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) @@ -1652,7 +1656,6 @@ process_options (void) default_debug_hooks = &vmsdbg_debug_hooks; #endif - debug_hooks = &do_nothing_debug_hooks; if (write_symbols == NO_DEBUG) ; #if defined(DBX_DEBUGGING_INFO) |