public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/29172] New: --combine can't handle #pragma once
@ 2006-09-21 18:07 acahalan at gmail dot com
2006-09-21 18:34 ` [Bug c/29172] " pinskia at gcc dot gnu dot org
` (8 more replies)
0 siblings, 9 replies; 10+ messages in thread
From: acahalan at gmail dot com @ 2006-09-21 18:07 UTC (permalink / raw)
To: gcc-bugs
The --combine option fails to forget the "once" property of a header file when
gcc moves on to dealing with the next *.c file. The pragma should function just
the same as the usual "#ifndef _SOME_ARBITRARY_CRAP" hack.
k 0 $ cat once.h
#pragma once
#define D
k 0 $ cat a.c
#include "once.h"
#ifndef D
#error No def in a.c!
#endif
k 0 $ cat b.c
#include "once.h"
#ifndef D
#error No def in b.c!
#endif
k 0 $ gcc --combine a.c b.c
b.c:3:2: error: #error No def in b.c!
k 1 $ gcc -v
Using built-in specs.
Target: x86_64-redhat-linux
Configured with: ../configure --prefix=/usr --mandir=/usr/share/man
--infodir=/usr/share/info --enable-shared --enable-threads=posix
--enable-checking=release --with-system-zlib --enable-__cxa_atexit
--disable-libunwind-exceptions --enable-libgcj-multifile
--enable-languages=c,c++,objc,obj-c++,java,fortran,ada --enable-java-awt=gtk
--disable-dssi --enable-plugin
--with-java-home=/usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/jre --with-cpu=generic
--host=x86_64-redhat-linux
Thread model: posix
gcc version 4.1.1 20060828 (Red Hat 4.1.1-20)
k 0 $
--
Summary: --combine can't handle #pragma once
Product: gcc
Version: 4.1.1
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: acahalan at gmail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29172
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug c/29172] --combine can't handle #pragma once
2006-09-21 18:07 [Bug c/29172] New: --combine can't handle #pragma once acahalan at gmail dot com
@ 2006-09-21 18:34 ` pinskia at gcc dot gnu dot org
2006-10-19 5:28 ` acahalan at gmail dot com
` (7 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2006-09-21 18:34 UTC (permalink / raw)
To: gcc-bugs
------- Comment #1 from pinskia at gcc dot gnu dot org 2006-09-21 18:34 -------
I bet the C front-end forgot to tell the preprocessor to rest the "pragma once"
table.
--
pinskia at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Severity|normal |enhancement
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29172
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug c/29172] --combine can't handle #pragma once
2006-09-21 18:07 [Bug c/29172] New: --combine can't handle #pragma once acahalan at gmail dot com
2006-09-21 18:34 ` [Bug c/29172] " pinskia at gcc dot gnu dot org
@ 2006-10-19 5:28 ` acahalan at gmail dot com
2006-12-05 23:15 ` pinskia at gcc dot gnu dot org
` (6 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: acahalan at gmail dot com @ 2006-10-19 5:28 UTC (permalink / raw)
To: gcc-bugs
------- Comment #2 from acahalan at gmail dot com 2006-10-19 05:28 -------
Why is this still UNCONFIRMED, and why is it marked enhancement?
The compiler is failing to follow the documented behavior.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29172
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug c/29172] --combine can't handle #pragma once
2006-09-21 18:07 [Bug c/29172] New: --combine can't handle #pragma once acahalan at gmail dot com
2006-09-21 18:34 ` [Bug c/29172] " pinskia at gcc dot gnu dot org
2006-10-19 5:28 ` acahalan at gmail dot com
@ 2006-12-05 23:15 ` pinskia at gcc dot gnu dot org
2006-12-06 4:07 ` acahalan at gmail dot com
` (5 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2006-12-05 23:15 UTC (permalink / raw)
To: gcc-bugs
------- Comment #3 from pinskia at gcc dot gnu dot org 2006-12-05 23:15 -------
(In reply to comment #2)
> The compiler is failing to follow the documented behavior.
Because I (or anyone else) have not got around to actually testing the testcase
:).
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29172
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug c/29172] --combine can't handle #pragma once
2006-09-21 18:07 [Bug c/29172] New: --combine can't handle #pragma once acahalan at gmail dot com
` (2 preceding siblings ...)
2006-12-05 23:15 ` pinskia at gcc dot gnu dot org
@ 2006-12-06 4:07 ` acahalan at gmail dot com
2007-09-27 22:04 ` tromey at gcc dot gnu dot org
` (4 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: acahalan at gmail dot com @ 2006-12-06 4:07 UTC (permalink / raw)
To: gcc-bugs
------- Comment #4 from acahalan at gmail dot com 2006-12-06 04:07 -------
(In reply to comment #3)
> (In reply to comment #2)
> > The compiler is failing to follow the documented behavior.
> Because I (or anyone else) have not got around to actually testing the testcase
> :).
I still don't see how this is an enhancement.
The compiler is documented to behave one way. It does something else.
That's not "add my new pet feature". That's "you have a clear defect".
Supposedly gcc supports "#pragma once" (it seems to, and is documented
as such) and supposedly gcc supports "--combine" (it seems to, kind of,
aside from the many bugs, but at least this feature is documented).
Nothing says that these features cause each other to break horribly,
yet they do.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29172
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug c/29172] --combine can't handle #pragma once
2006-09-21 18:07 [Bug c/29172] New: --combine can't handle #pragma once acahalan at gmail dot com
` (3 preceding siblings ...)
2006-12-06 4:07 ` acahalan at gmail dot com
@ 2007-09-27 22:04 ` tromey at gcc dot gnu dot org
2007-11-12 20:24 ` tromey at gcc dot gnu dot org
` (3 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: tromey at gcc dot gnu dot org @ 2007-09-27 22:04 UTC (permalink / raw)
To: gcc-bugs
------- Comment #5 from tromey at gcc dot gnu dot org 2007-09-27 22:04 -------
Confirmed.
The problem is that the loop in c_common_parse_file calls
cpp_undef_all -- which undefines all symbols but does not
mark _cpp_file objects as not seen.
We probably need a new libcpp API for this.
--
tromey at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |tromey at gcc dot gnu dot
| |org
Status|UNCONFIRMED |NEW
Ever Confirmed|0 |1
Last reconfirmed|0000-00-00 00:00:00 |2007-09-27 22:04:24
date| |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29172
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug c/29172] --combine can't handle #pragma once
2006-09-21 18:07 [Bug c/29172] New: --combine can't handle #pragma once acahalan at gmail dot com
` (4 preceding siblings ...)
2007-09-27 22:04 ` tromey at gcc dot gnu dot org
@ 2007-11-12 20:24 ` tromey at gcc dot gnu dot org
2007-12-06 18:56 ` tromey at gcc dot gnu dot org
` (2 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: tromey at gcc dot gnu dot org @ 2007-11-12 20:24 UTC (permalink / raw)
To: gcc-bugs
------- Comment #6 from tromey at gcc dot gnu dot org 2007-11-12 20:24 -------
Testing a patch.
--
tromey at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
AssignedTo|unassigned at gcc dot gnu |tromey at gcc dot gnu dot
|dot org |org
Status|NEW |ASSIGNED
Last reconfirmed|2007-09-27 22:04:24 |2007-11-12 20:24:41
date| |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29172
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug c/29172] --combine can't handle #pragma once
2006-09-21 18:07 [Bug c/29172] New: --combine can't handle #pragma once acahalan at gmail dot com
` (5 preceding siblings ...)
2007-11-12 20:24 ` tromey at gcc dot gnu dot org
@ 2007-12-06 18:56 ` tromey at gcc dot gnu dot org
2007-12-06 18:58 ` tromey at gcc dot gnu dot org
2007-12-08 20:11 ` pinskia at gcc dot gnu dot org
8 siblings, 0 replies; 10+ messages in thread
From: tromey at gcc dot gnu dot org @ 2007-12-06 18:56 UTC (permalink / raw)
To: gcc-bugs
------- Comment #7 from tromey at gcc dot gnu dot org 2007-12-06 18:56 -------
Subject: Bug 29172
Author: tromey
Date: Thu Dec 6 18:56:26 2007
New Revision: 130656
URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=130656
Log:
gcc
PR c/29172:
* c-opts.c (c_common_parse_file): Call cpp_clear_file_cache.
libcpp
PR c/29172:
* internal.h (struct cpp_reader) <file_hash_entries>: Changed
type.
<file_hash_entries_allocated, file_hash_entries_used>: Removed.
* files.c (FILE_HASH_POOL_SIZE): New macro.
(struct file_hash_entry_pool): New.
(destroy_all_cpp_files): New function.
(allocate_file_hash_entries): Allocate a file_hash_entry_pool.
(new_file_hash_entry): Update.
(free_file_hash_entries): New function.
(_cpp_cleanup_files): Call free_file_hash_entries and
destroy_all_cpp_files.
(cpp_clear_file_cache): New function.
* include/cpplib.h (cpp_clear_file_cache): Declare.
Modified:
trunk/gcc/ChangeLog
trunk/gcc/c-opts.c
trunk/libcpp/ChangeLog
trunk/libcpp/files.c
trunk/libcpp/include/cpplib.h
trunk/libcpp/internal.h
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29172
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug c/29172] --combine can't handle #pragma once
2006-09-21 18:07 [Bug c/29172] New: --combine can't handle #pragma once acahalan at gmail dot com
` (6 preceding siblings ...)
2007-12-06 18:56 ` tromey at gcc dot gnu dot org
@ 2007-12-06 18:58 ` tromey at gcc dot gnu dot org
2007-12-08 20:11 ` pinskia at gcc dot gnu dot org
8 siblings, 0 replies; 10+ messages in thread
From: tromey at gcc dot gnu dot org @ 2007-12-06 18:58 UTC (permalink / raw)
To: gcc-bugs
------- Comment #8 from tromey at gcc dot gnu dot org 2007-12-06 18:58 -------
Fixed on trunk.
--
tromey at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Known to work| |4.3.0
Target Milestone|--- |4.3.0
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29172
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug c/29172] --combine can't handle #pragma once
2006-09-21 18:07 [Bug c/29172] New: --combine can't handle #pragma once acahalan at gmail dot com
` (7 preceding siblings ...)
2007-12-06 18:58 ` tromey at gcc dot gnu dot org
@ 2007-12-08 20:11 ` pinskia at gcc dot gnu dot org
8 siblings, 0 replies; 10+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2007-12-08 20:11 UTC (permalink / raw)
To: gcc-bugs
------- Comment #9 from pinskia at gcc dot gnu dot org 2007-12-08 20:11 -------
Fixed so closing.
--
pinskia at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|ASSIGNED |RESOLVED
Resolution| |FIXED
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29172
^ permalink raw reply [flat|nested] 10+ messages in thread
end of thread, other threads:[~2007-12-08 20:11 UTC | newest]
Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-09-21 18:07 [Bug c/29172] New: --combine can't handle #pragma once acahalan at gmail dot com
2006-09-21 18:34 ` [Bug c/29172] " pinskia at gcc dot gnu dot org
2006-10-19 5:28 ` acahalan at gmail dot com
2006-12-05 23:15 ` pinskia at gcc dot gnu dot org
2006-12-06 4:07 ` acahalan at gmail dot com
2007-09-27 22:04 ` tromey at gcc dot gnu dot org
2007-11-12 20:24 ` tromey at gcc dot gnu dot org
2007-12-06 18:56 ` tromey at gcc dot gnu dot org
2007-12-06 18:58 ` tromey at gcc dot gnu dot org
2007-12-08 20:11 ` pinskia 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).