public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug pch/15007] New: crash when including precompiled header with -include
@ 2004-04-18 21:23 bryner at brianryner dot com
  2004-04-18 21:29 ` [Bug pch/15007] " bryner at brianryner dot com
                   ` (11 more replies)
  0 siblings, 12 replies; 13+ messages in thread
From: bryner at brianryner dot com @ 2004-04-18 21:23 UTC (permalink / raw)
  To: gcc-bugs

Using a trunk gcc build pulled today, I get a crash if I include a precompiled
header with -include.  For example,

pchtest.h:
void foo (void);

pchtest.c:
<empty>

gcc -c -o pchtest.h.gch pchtest.h
gcc -c -o pchtest.o pchtest.c -include -pchtest.h
pchtest.c:1: internal compiler error: Segmentation fault
Please submit a full bug report,
with preprocessed source if appropriate.

cc1 backtrace:
#0  0x0806a580 in c_write_global_declarations () at ../../gcc/gcc/c-decl.c:6629
#1  0x082e28c4 in toplev_main (argc=0, argv=0x0) at ../../gcc/gcc/toplev.c:1608
#2  0x080a8d9e in main (argc=0, argv=0x0) at ../../gcc/gcc/main.c:35

-- 
           Summary: crash when including precompiled header with -include
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: critical
          Priority: P2
         Component: pch
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: bryner at brianryner dot com
                CC: gcc-bugs at gcc dot gnu dot org
  GCC host triplet: i686-pc-linux-gnu


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


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

* [Bug pch/15007] crash when including precompiled header with -include
  2004-04-18 21:23 [Bug pch/15007] New: crash when including precompiled header with -include bryner at brianryner dot com
@ 2004-04-18 21:29 ` bryner at brianryner dot com
  2004-04-18 21:42 ` bryner at brianryner dot com
                   ` (10 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: bryner at brianryner dot com @ 2004-04-18 21:29 UTC (permalink / raw)
  To: gcc-bugs



-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |ice-on-valid-code


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


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

* [Bug c/15007] [3.5 Regression] crash when including precompiled header with -include
  2004-04-18 21:23 [Bug pch/15007] New: crash when including precompiled header with -include bryner at brianryner dot com
  2004-04-18 21:29 ` [Bug pch/15007] " bryner at brianryner dot com
  2004-04-18 21:42 ` bryner at brianryner dot com
@ 2004-04-18 21:42 ` pinskia at gcc dot gnu dot org
  2004-04-22  3:25 ` pinskia at gcc dot gnu dot org
                   ` (8 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-04-18 21:42 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2004-04-18 21:23 -------
Confirmed, I think this is caused by Zack's rewrite of c-decl.

Zack,
  I know that you are help on the release of 3.4.0 but after the release could you look into this?
I almost think it is because c-decl creates a translation_unit_decl even if it does not need to but I have
not looked into it at all except that in the non PCH case there is only one translation_unit_decl while in 
the PCH case there are two.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |zack at gcc dot gnu dot org
             Status|UNCONFIRMED                 |NEW
          Component|pch                         |c
     Ever Confirmed|                            |1
      Known to fail|                            |3.5.0
      Known to work|                            |3.4.0
   Last reconfirmed|0000-00-00 00:00:00         |2004-04-18 21:23:23
               date|                            |
            Summary|crash when including        |[3.5 Regression] crash when
                   |precompiled header with -   |including precompiled header
                   |include                     |with -include
   Target Milestone|---                         |3.5.0
            Version|unknown                     |3.5.0


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


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

* [Bug pch/15007] crash when including precompiled header with -include
  2004-04-18 21:23 [Bug pch/15007] New: crash when including precompiled header with -include bryner at brianryner dot com
  2004-04-18 21:29 ` [Bug pch/15007] " bryner at brianryner dot com
@ 2004-04-18 21:42 ` bryner at brianryner dot com
  2004-04-18 21:42 ` [Bug c/15007] [3.5 Regression] " pinskia at gcc dot gnu dot org
                   ` (9 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: bryner at brianryner dot com @ 2004-04-18 21:42 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From bryner at brianryner dot com  2004-04-18 21:16 -------
(In reply to comment #0)
> gcc -c -o pchtest.o pchtest.c -include -pchtest.h
                                         ^^
That last dash is a typo in the bug report.

-- 


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


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

* [Bug c/15007] [3.5 Regression] crash when including precompiled header with -include
  2004-04-18 21:23 [Bug pch/15007] New: crash when including precompiled header with -include bryner at brianryner dot com
                   ` (2 preceding siblings ...)
  2004-04-18 21:42 ` [Bug c/15007] [3.5 Regression] " pinskia at gcc dot gnu dot org
@ 2004-04-22  3:25 ` pinskia at gcc dot gnu dot org
  2004-04-22  3:51 ` geoffk at gcc dot gnu dot org
                   ` (7 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-04-22  3:25 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2004-04-22 02:45 -------
*** Bug 15060 has been marked as a duplicate of this bug. ***

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |geoffk at gcc dot gnu dot
                   |                            |org


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


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

* [Bug c/15007] [3.5 Regression] crash when including precompiled header with -include
  2004-04-18 21:23 [Bug pch/15007] New: crash when including precompiled header with -include bryner at brianryner dot com
                   ` (3 preceding siblings ...)
  2004-04-22  3:25 ` pinskia at gcc dot gnu dot org
@ 2004-04-22  3:51 ` geoffk at gcc dot gnu dot org
  2004-04-22  8:38 ` geoffk at gcc dot gnu dot org
                   ` (6 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: geoffk at gcc dot gnu dot org @ 2004-04-22  3:51 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From geoffk at gcc dot gnu dot org  2004-04-22 02:51 -------
See bug 15060 for more analysis.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
         AssignedTo|unassigned at gcc dot gnu   |zack at gcc dot gnu dot org
                   |dot org                     |
             Status|NEW                         |ASSIGNED


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


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

* [Bug c/15007] [3.5 Regression] crash when including precompiled header with -include
  2004-04-18 21:23 [Bug pch/15007] New: crash when including precompiled header with -include bryner at brianryner dot com
                   ` (4 preceding siblings ...)
  2004-04-22  3:51 ` geoffk at gcc dot gnu dot org
@ 2004-04-22  8:38 ` geoffk at gcc dot gnu dot org
  2004-05-01  5:26 ` zack at gcc dot gnu dot org
                   ` (5 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: geoffk at gcc dot gnu dot org @ 2004-04-22  8:38 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From geoffk at gcc dot gnu dot org  2004-04-22 05:39 -------
The problem is that there are two TRANSLATION_UNIT_DECLs.  One appears to come from the PCH file, 
and is incomplete.  I am not sure where the other one comes from; possibly it is created after the PCH 
file is loaded.  There should, of course, be only one TRANSLATION_UNIT_DECL, since there is only one 
translation unit.  So, I suspect a problem with the timing of PCH saving and/or restoring.

I've confirmed that this crash does not happen immedately before Zack's 2004-03-23 patch, and does 
happen immediately after it was applied.  I find it particularly suspicious that this patch introduced a 
number of constructs of the form "if (pch_file) return;"; such constructs were not necessary before, and 
it is likely that these are bandaids for deeper problems.


-- 


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


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

* [Bug c/15007] [3.5 Regression] crash when including precompiled header with -include
  2004-04-18 21:23 [Bug pch/15007] New: crash when including precompiled header with -include bryner at brianryner dot com
                   ` (5 preceding siblings ...)
  2004-04-22  8:38 ` geoffk at gcc dot gnu dot org
@ 2004-05-01  5:26 ` zack at gcc dot gnu dot org
  2004-05-01  5:26 ` zack at gcc dot gnu dot org
                   ` (4 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: zack at gcc dot gnu dot org @ 2004-05-01  5:26 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From zack at gcc dot gnu dot org  2004-05-01 05:26 -------
(From update of attachment 6204)
attachment tweak: fix mime type, mark patch


-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
   Attachment #6204|pr15007.diff                |.
        description|                            |
   Attachment #6204|text/x-patch                |text/plain
          mime type|                            |
Attachment #6204 is|0                           |1
              patch|                            |


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


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

* [Bug c/15007] [3.5 Regression] crash when including precompiled header with -include
  2004-04-18 21:23 [Bug pch/15007] New: crash when including precompiled header with -include bryner at brianryner dot com
                   ` (6 preceding siblings ...)
  2004-05-01  5:26 ` zack at gcc dot gnu dot org
@ 2004-05-01  5:26 ` zack at gcc dot gnu dot org
  2004-05-04 17:54 ` mrs at apple dot com
                   ` (3 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: zack at gcc dot gnu dot org @ 2004-05-01  5:26 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From zack at gcc dot gnu dot org  2004-05-01 05:26 -------
ve have ze patch.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |patch


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


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

* [Bug c/15007] [3.5 Regression] crash when including precompiled header with -include
  2004-04-18 21:23 [Bug pch/15007] New: crash when including precompiled header with -include bryner at brianryner dot com
                   ` (7 preceding siblings ...)
  2004-05-01  5:26 ` zack at gcc dot gnu dot org
@ 2004-05-04 17:54 ` mrs at apple dot com
  2004-05-05 23:10 ` bowdidge at apple dot com
                   ` (2 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: mrs at apple dot com @ 2004-05-04 17:54 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From mrs at apple dot com  2004-05-04 17:54 -------
The patch seems to work as expected and fix this problem on powerpc-apple-darwin7.2.0.

-- 


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


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

* [Bug c/15007] [3.5 Regression] crash when including precompiled header with -include
  2004-04-18 21:23 [Bug pch/15007] New: crash when including precompiled header with -include bryner at brianryner dot com
                   ` (8 preceding siblings ...)
  2004-05-04 17:54 ` mrs at apple dot com
@ 2004-05-05 23:10 ` bowdidge at apple dot com
  2004-05-09 21:27 ` cvs-commit at gcc dot gnu dot org
  2004-05-09 21:28 ` zack at gcc dot gnu dot org
  11 siblings, 0 replies; 13+ messages in thread
From: bowdidge at apple dot com @ 2004-05-05 23:10 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From bowdidge at apple dot com  2004-05-05 23:10 -------
This bug would hit if I tried to build the Qt sources with the top-of-tree gcc in the FSF repository.  After 
applying the patch, Qt would no longer hit this bug.  Thanks!

-- 


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


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

* [Bug c/15007] [3.5 Regression] crash when including precompiled header with -include
  2004-04-18 21:23 [Bug pch/15007] New: crash when including precompiled header with -include bryner at brianryner dot com
                   ` (9 preceding siblings ...)
  2004-05-05 23:10 ` bowdidge at apple dot com
@ 2004-05-09 21:27 ` cvs-commit at gcc dot gnu dot org
  2004-05-09 21:28 ` zack at gcc dot gnu dot org
  11 siblings, 0 replies; 13+ messages in thread
From: cvs-commit at gcc dot gnu dot org @ 2004-05-09 21:27 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From cvs-commit at gcc dot gnu dot org  2004-05-09 21:27 -------
Subject: Bug 15007

CVSROOT:	/cvs/gcc
Module name:	gcc
Changes by:	zack@gcc.gnu.org	2004-05-09 21:27:00

Modified files:
	gcc            : ChangeLog c-decl.c 

Log message:
	PR 15007
	* c-decl.c (current_file_decl): Rename to all_translation_units,
	adjust comment.
	(pop_scope): If popping file_scope, construct a
	TRANSLATION_UNIT_DECL and make it the context of all the
	symbols in the scope.
	(push_file_scope): Don't construct a TRANSLATION_UNIT_DECL here.
	(pushdecl): Clarify comment.  Do not set DECL_CONTEXT of
	anything to current_file_decl.
	(pushdecl_top_level): Likewise.
	(store_parm_decls_newstyle): Adjust check for nested function.
	(c_write_global_declarations): Update for renamed variable.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ChangeLog.diff?cvsroot=gcc&r1=2.3611&r2=2.3612
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/c-decl.c.diff?cvsroot=gcc&r1=1.496&r2=1.497



-- 


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


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

* [Bug c/15007] [3.5 Regression] crash when including precompiled header with -include
  2004-04-18 21:23 [Bug pch/15007] New: crash when including precompiled header with -include bryner at brianryner dot com
                   ` (10 preceding siblings ...)
  2004-05-09 21:27 ` cvs-commit at gcc dot gnu dot org
@ 2004-05-09 21:28 ` zack at gcc dot gnu dot org
  11 siblings, 0 replies; 13+ messages in thread
From: zack at gcc dot gnu dot org @ 2004-05-09 21:28 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From zack at gcc dot gnu dot org  2004-05-09 21:28 -------
patch checked in

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


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


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

end of thread, other threads:[~2004-05-09 21:28 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-04-18 21:23 [Bug pch/15007] New: crash when including precompiled header with -include bryner at brianryner dot com
2004-04-18 21:29 ` [Bug pch/15007] " bryner at brianryner dot com
2004-04-18 21:42 ` bryner at brianryner dot com
2004-04-18 21:42 ` [Bug c/15007] [3.5 Regression] " pinskia at gcc dot gnu dot org
2004-04-22  3:25 ` pinskia at gcc dot gnu dot org
2004-04-22  3:51 ` geoffk at gcc dot gnu dot org
2004-04-22  8:38 ` geoffk at gcc dot gnu dot org
2004-05-01  5:26 ` zack at gcc dot gnu dot org
2004-05-01  5:26 ` zack at gcc dot gnu dot org
2004-05-04 17:54 ` mrs at apple dot com
2004-05-05 23:10 ` bowdidge at apple dot com
2004-05-09 21:27 ` cvs-commit at gcc dot gnu dot org
2004-05-09 21:28 ` zack at gcc dot gnu dot org

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