public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug preprocessor/14103] New: gcc-3.4-20040206.tar.bz2  ICEs on "gcc -E -imacros foo.h baz.c"
@ 2004-02-11  0:59 lindsayd at cisco dot com
  2004-02-11  1:17 ` [Bug preprocessor/14103] [3.4/3.5 Regression] " pinskia at gcc dot gnu dot org
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: lindsayd at cisco dot com @ 2004-02-11  0:59 UTC (permalink / raw)
  To: gcc-bugs

I built a native compiler on i686-pc-linux-gnu from
the most recent weekly snapshot, gcc-3.4-20040206.tar.bz2.

The following test makes it seg fault/ICE:
    echo > empty.c
    echo > empty.h
    gcc -E -imacros empty.h empty.c > Efile

      empty.c:0: internal compiler error: Segmentation fault
      Please submit a full bug report,
      with preprocessed source if appropriate.
      See <URL:http://gcc.gnu.org/bugs.html> for instructions.

This does not happen with the compiler I built from gcc-3.4-20040128.tar.bz2, so
it's a regresssion in the last week.

No, the source files don't have to be empty to trigger this. The empty inputs
are my cutdown :-)

Both the 2040206 and 20040128 builds were with GCC sources cpio-merged on top of
binutils-2.14/newlib-1.11.0, and using the configuration options:

--with-gnu-as --enable-languages=c++ --enable-threads --enable-shared
--target=native --prefix=$INSTALL_DIR

-- 
           Summary: gcc-3.4-20040206.tar.bz2  ICEs on "gcc -E -imacros foo.h
                    baz.c"
           Product: gcc
           Version: 3.4.0
            Status: UNCONFIRMED
          Severity: critical
          Priority: P2
         Component: preprocessor
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: lindsayd at cisco dot com
                CC: gcc-bugs at gcc dot gnu dot org
  GCC host triplet: i686-pc-linux-gnu
GCC target triplet: native


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14103


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

* [Bug preprocessor/14103] [3.4/3.5 Regression] ICEs on "gcc -E -imacros foo.h baz.c"
  2004-02-11  0:59 [Bug preprocessor/14103] New: gcc-3.4-20040206.tar.bz2 ICEs on "gcc -E -imacros foo.h baz.c" lindsayd at cisco dot com
@ 2004-02-11  1:17 ` pinskia at gcc dot gnu dot org
  2004-02-11 17:23 ` bothner at gcc dot gnu dot org
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-02-11  1:17 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2004-02-11 01:17 -------
Confirmed A regression.
I think this is caused by:
2004-02-04  Per Bothner  <per@bothner.com>
        
        Partially revert/redo 2003-10-01 change; fix -fworking-directory.
        * c-ppoutput.c (pp_dir_change):  New function.
        * c-common.h (pp_dir_change):  New declaration.
        * cpplib.h (struct cpp_options):  Remove working_directory field.
        * cppinit.c (cpp_find_main_file, cpp_push_main_file):  Merge back to
        (cpp_read_main_file):  as before 10-01.  Call _cpp_stack_file.
        Don't handle -fworking_directory here, but in c_common_post_options.
        (read_original_directory): Don't back up when done.
        Don't clear no-longer used working_directory flag.
        * cpplib.h:  Update declarations to match.
        * c-lex.c (cb_dir_change):  Move to c-opts.c.
        (init_c_lex):  Don't set dir_change callback here, since we want
        to set it even if flag_preprocess_only.
        * c-opts.c (cb_dir_change):  Function moved from c-lex.c.
        (c_common_post_options):  Set dir_change callback.
        Call pp_dir_change if approporiate.
        (finish_options):  Don't call cpp_find_main_file here.  Hence remove
        unneeded parameter and result. Do LC_RENAME for <built-in>.
        (c_common_post_options):  Call cpp_read_main_file here instead.
        (c_common_init):  Update accordingly.
        (push_command_line_include):  Don't cpp_push_main_file.
        Do LC_RENAME rather than LC_LEASE to get back to main file.
        Compared to pre-10-01 version, inline cpp_rename_to_main_file.
        (c_common_parse_file):  Call cpp_read_main_file for subsequent main
        files, but call finish_options for all files.
        * c-opts.c (sanitize_cpp_opts):  Don't set cpp_opts->working_directory.
        * fix-header.c (read_scan_file):  Call cpp_read_main_file instead of
        cpp_find_main_file + cpp_push_main_file.
        * c-lex.c (fe_file_change):  Don't set main_input_filename here.
        * opts.c (handle_options):  Only set main_input_filename first time.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |per at bothner dot com
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|                            |1
           Keywords|                            |ice-on-valid-code
      Known to fail|                            |3.4.0 3.5.0
      Known to work|                            |3.3.3
   Last reconfirmed|0000-00-00 00:00:00         |2004-02-11 01:17:32
               date|                            |
            Summary|gcc-3.4-20040206.tar.bz2    |[3.4/3.5 Regression] ICEs on
                   |ICEs on "gcc -E -imacros    |"gcc -E -imacros foo.h
                   |foo.h baz.c"                |baz.c"
   Target Milestone|---                         |3.4.0


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14103


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

* [Bug preprocessor/14103] [3.4/3.5 Regression] ICEs on "gcc -E -imacros foo.h baz.c"
  2004-02-11  0:59 [Bug preprocessor/14103] New: gcc-3.4-20040206.tar.bz2 ICEs on "gcc -E -imacros foo.h baz.c" lindsayd at cisco dot com
  2004-02-11  1:17 ` [Bug preprocessor/14103] [3.4/3.5 Regression] " pinskia at gcc dot gnu dot org
@ 2004-02-11 17:23 ` bothner at gcc dot gnu dot org
  2004-02-18 22:03 ` cvs-commit at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: bothner at gcc dot gnu dot org @ 2004-02-11 17:23 UTC (permalink / raw)
  To: gcc-bugs



-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |ASSIGNED
   Last reconfirmed|2004-02-11 01:17:32         |2004-02-11 17:23:30
               date|                            |


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14103


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

* [Bug preprocessor/14103] [3.4/3.5 Regression] ICEs on "gcc -E -imacros foo.h baz.c"
  2004-02-11  0:59 [Bug preprocessor/14103] New: gcc-3.4-20040206.tar.bz2 ICEs on "gcc -E -imacros foo.h baz.c" lindsayd at cisco dot com
  2004-02-11  1:17 ` [Bug preprocessor/14103] [3.4/3.5 Regression] " pinskia at gcc dot gnu dot org
  2004-02-11 17:23 ` bothner at gcc dot gnu dot org
@ 2004-02-18 22:03 ` cvs-commit at gcc dot gnu dot org
  2004-02-18 22:10 ` cvs-commit at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: cvs-commit at gcc dot gnu dot org @ 2004-02-18 22:03 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From cvs-commit at gcc dot gnu dot org  2004-02-18 22:02 -------
Subject: Bug 14103

CVSROOT:	/cvs/gcc
Module name:	gcc
Changes by:	bothner@gcc.gnu.org	2004-02-18 22:02:53

Modified files:
	gcc            : c-ppoutput.c cppfiles.c cpphash.h cpplex.c 
	                 cppmacro.c line-map.h ChangeLog 

Log message:
	* cpphash.h (struct cpp_buffer):  Restore return_at_eof field.  This
	partly reverts my 2003-10-01 change, because we're back to logically
	including <command line> inside the main line.
	* cpplex.c (_cpp_get_fresh_line):  Check return_at_eof field.
	* cppmacro.c (cpp_scan_nooutput):  Set return_at_eof of current buffer.
	Fixes PR preprocessor/14103.
	
	* cppfiles.c (_cpp_stack_include):  When appropriate decrement
	line_table's highest_location, fixing LAST_SOURCE_LINE_LOCATION.
	(cpp_push_include):  Don't need to increment pfile's line field.
	* line-map.h (LAST_SOURCE_LINE_LOCATION):  Only decrement by 1.
	
	* c-ppoutput.c (print struct):  New first_time field.
	(init_pp_output):  Set print.first_time.
	(pp_file_change):  Use print.first_time, rather than MAIN_FILE_P,
	which is set also for (say) <command line>.  Clear print.first_time.
	
	* cppfiles.c (struct _cpp_file):  Comment and type for pch field
	does not match the code, so fix both.
	(should_stack_file):  Inline include_pch_p function.
	(include_pch_p):  Remove pointless function.
	
	* cpphash.h (struct cpp_buffer):  Remove unused search_cached field.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/c-ppoutput.c.diff?cvsroot=gcc&r1=1.16&r2=1.17
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cppfiles.c.diff?cvsroot=gcc&r1=1.202&r2=1.203
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cpphash.h.diff?cvsroot=gcc&r1=1.211&r2=1.212
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cpplex.c.diff?cvsroot=gcc&r1=1.252&r2=1.253
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cppmacro.c.diff?cvsroot=gcc&r1=1.144&r2=1.145
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/line-map.h.diff?cvsroot=gcc&r1=1.20&r2=1.21
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ChangeLog.diff?cvsroot=gcc&r1=2.2830&r2=2.2831



-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14103


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

* [Bug preprocessor/14103] [3.4/3.5 Regression] ICEs on "gcc -E -imacros foo.h baz.c"
  2004-02-11  0:59 [Bug preprocessor/14103] New: gcc-3.4-20040206.tar.bz2 ICEs on "gcc -E -imacros foo.h baz.c" lindsayd at cisco dot com
                   ` (2 preceding siblings ...)
  2004-02-18 22:03 ` cvs-commit at gcc dot gnu dot org
@ 2004-02-18 22:10 ` cvs-commit at gcc dot gnu dot org
  2004-02-18 22:20 ` pinskia at gcc dot gnu dot org
  2004-02-19  7:06 ` 1319 at bot dot ru
  5 siblings, 0 replies; 7+ messages in thread
From: cvs-commit at gcc dot gnu dot org @ 2004-02-18 22:10 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From cvs-commit at gcc dot gnu dot org  2004-02-18 22:10 -------
Subject: Bug 14103

CVSROOT:	/cvs/gcc
Module name:	gcc
Branch: 	gcc-3_4-branch
Changes by:	bothner@gcc.gnu.org	2004-02-18 22:10:46

Modified files:
	gcc            : cpphash.h cpplex.c cppmacro.c ChangeLog 

Log message:
	* cpphash.h (struct cpp_buffer):  Restore return_at_eof field.  This
	partly reverts my 2003-10-01 change, because we're back to logically
	including <command line> inside the main line.
	* cpplex.c (_cpp_get_fresh_line):  Check return_at_eof field.
	* cppmacro.c (cpp_scan_nooutput):  Set return_at_eof of current buffer.
	Fixes PR preprocessor/14103.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cpphash.h.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=1.203.4.2&r2=1.203.4.3
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cpplex.c.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=1.250&r2=1.250.6.1
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cppmacro.c.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=1.141&r2=1.141.6.1
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=2.2326.2.215&r2=2.2326.2.216



-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14103


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

* [Bug preprocessor/14103] [3.4/3.5 Regression] ICEs on "gcc -E -imacros foo.h baz.c"
  2004-02-11  0:59 [Bug preprocessor/14103] New: gcc-3.4-20040206.tar.bz2 ICEs on "gcc -E -imacros foo.h baz.c" lindsayd at cisco dot com
                   ` (3 preceding siblings ...)
  2004-02-18 22:10 ` cvs-commit at gcc dot gnu dot org
@ 2004-02-18 22:20 ` pinskia at gcc dot gnu dot org
  2004-02-19  7:06 ` 1319 at bot dot ru
  5 siblings, 0 replies; 7+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-02-18 22:20 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2004-02-18 22:20 -------
Fixed.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
         Resolution|                            |FIXED


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14103


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

* [Bug preprocessor/14103] [3.4/3.5 Regression] ICEs on "gcc -E -imacros foo.h baz.c"
  2004-02-11  0:59 [Bug preprocessor/14103] New: gcc-3.4-20040206.tar.bz2 ICEs on "gcc -E -imacros foo.h baz.c" lindsayd at cisco dot com
                   ` (4 preceding siblings ...)
  2004-02-18 22:20 ` pinskia at gcc dot gnu dot org
@ 2004-02-19  7:06 ` 1319 at bot dot ru
  5 siblings, 0 replies; 7+ messages in thread
From: 1319 at bot dot ru @ 2004-02-19  7:06 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From 1319 at bot dot ru  2004-02-19 07:06 -------
*** Bug 14205 has been marked as a duplicate of this bug. ***

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |1319 at bot dot ru


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14103


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

end of thread, other threads:[~2004-02-19  7:06 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-02-11  0:59 [Bug preprocessor/14103] New: gcc-3.4-20040206.tar.bz2 ICEs on "gcc -E -imacros foo.h baz.c" lindsayd at cisco dot com
2004-02-11  1:17 ` [Bug preprocessor/14103] [3.4/3.5 Regression] " pinskia at gcc dot gnu dot org
2004-02-11 17:23 ` bothner at gcc dot gnu dot org
2004-02-18 22:03 ` cvs-commit at gcc dot gnu dot org
2004-02-18 22:10 ` cvs-commit at gcc dot gnu dot org
2004-02-18 22:20 ` pinskia at gcc dot gnu dot org
2004-02-19  7:06 ` 1319 at bot dot ru

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).