public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/22065] -fdump-tree-original causes static function to emitted with the same name
[not found] <bug-22065-6528@http.gcc.gnu.org/bugzilla/>
@ 2005-10-16 3:48 ` pinskia at gcc dot gnu dot org
2005-10-16 3:50 ` pinskia at gcc dot gnu dot org
` (6 subsequent siblings)
7 siblings, 0 replies; 10+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-10-16 3:48 UTC (permalink / raw)
To: gcc-bugs
------- Comment #2 from pinskia at gcc dot gnu dot org 2005-10-16 03:48 -------
Hmm, the only problem with calling DECL_NAME I think is with C++ code but I
have to double check on that.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=22065
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug c/22065] -fdump-tree-original causes static function to emitted with the same name
[not found] <bug-22065-6528@http.gcc.gnu.org/bugzilla/>
2005-10-16 3:48 ` [Bug c/22065] -fdump-tree-original causes static function to emitted with the same name pinskia at gcc dot gnu dot org
@ 2005-10-16 3:50 ` pinskia at gcc dot gnu dot org
2005-10-16 4:27 ` pinskia at gcc dot gnu dot org
` (5 subsequent siblings)
7 siblings, 0 replies; 10+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-10-16 3:50 UTC (permalink / raw)
To: gcc-bugs
------- Comment #3 from pinskia at gcc dot gnu dot org 2005-10-16 03:50 -------
Yes, with the C++ dumps, we would like the assemble name.
Maybe we are calling c_genericize too early.
I am going to look into this more.
--
pinskia at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
AssignedTo|unassigned at gcc dot gnu |pinskia at gcc dot gnu dot
|dot org |org
Status|NEW |ASSIGNED
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=22065
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug c/22065] -fdump-tree-original causes static function to emitted with the same name
[not found] <bug-22065-6528@http.gcc.gnu.org/bugzilla/>
2005-10-16 3:48 ` [Bug c/22065] -fdump-tree-original causes static function to emitted with the same name pinskia at gcc dot gnu dot org
2005-10-16 3:50 ` pinskia at gcc dot gnu dot org
@ 2005-10-16 4:27 ` pinskia at gcc dot gnu dot org
2005-10-16 16:18 ` pinskia at gcc dot gnu dot org
` (4 subsequent siblings)
7 siblings, 0 replies; 10+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-10-16 4:27 UTC (permalink / raw)
To: gcc-bugs
------- Comment #4 from pinskia at gcc dot gnu dot org 2005-10-16 04:27 -------
Created an attachment (id=9999)
--> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=9999&action=view)
Patch which should fix it but needs testing
This patch moves where we do the finalizing of the function in unit at a time
mode from when we finish a function to when we pop the file scope. This will
fix the -fdump-tree-orginal problem but I don't know if it works in all cases.
I have not done a bootstrap/test on this yet but I will be doing that tonight
with also a --enable-intermodule build with -fdump-tree-all-vops so we get the
code really tested.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=22065
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug c/22065] -fdump-tree-original causes static function to emitted with the same name
[not found] <bug-22065-6528@http.gcc.gnu.org/bugzilla/>
` (2 preceding siblings ...)
2005-10-16 4:27 ` pinskia at gcc dot gnu dot org
@ 2005-10-16 16:18 ` pinskia at gcc dot gnu dot org
2005-10-16 16:45 ` pinskia at gcc dot gnu dot org
` (3 subsequent siblings)
7 siblings, 0 replies; 10+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-10-16 16:18 UTC (permalink / raw)
To: gcc-bugs
------- Comment #5 from pinskia at gcc dot gnu dot org 2005-10-16 16:18 -------
(In reply to comment #4)
> Created an attachment (id=9999)
--> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=9999&action=view) [edit]
> Patch which should fix it but needs testing
Note this patch does not work. We are trying to access an already free block.
I have not looked into it yet but the short testcase is:
extern inline int f(void){}
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=22065
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug c/22065] -fdump-tree-original causes static function to emitted with the same name
[not found] <bug-22065-6528@http.gcc.gnu.org/bugzilla/>
` (3 preceding siblings ...)
2005-10-16 16:18 ` pinskia at gcc dot gnu dot org
@ 2005-10-16 16:45 ` pinskia at gcc dot gnu dot org
2005-10-16 17:01 ` pinskia at gcc dot gnu dot org
` (2 subsequent siblings)
7 siblings, 0 replies; 10+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-10-16 16:45 UTC (permalink / raw)
To: gcc-bugs
------- Comment #6 from pinskia at gcc dot gnu dot org 2005-10-16 16:45 -------
(In reply to comment #5)
> Note this patch does not work. We are trying to access an already free block.
> I have not looked into it yet but the short testcase is:
> extern inline int f(void){}
I know why now, c_genericize or cgraph_finalize_function calls ggc_collect and
the new block is not going to be marked as used.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=22065
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug c/22065] -fdump-tree-original causes static function to emitted with the same name
[not found] <bug-22065-6528@http.gcc.gnu.org/bugzilla/>
` (4 preceding siblings ...)
2005-10-16 16:45 ` pinskia at gcc dot gnu dot org
@ 2005-10-16 17:01 ` pinskia at gcc dot gnu dot org
2005-10-16 18:52 ` pinskia at gcc dot gnu dot org
2005-10-23 0:04 ` pinskia at gcc dot gnu dot org
7 siblings, 0 replies; 10+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-10-16 17:01 UTC (permalink / raw)
To: gcc-bugs
------- Comment #7 from pinskia at gcc dot gnu dot org 2005-10-16 17:01 -------
I have a new patch which I am testing right now. The only change between this
patch and the one attached is an additional static variable to make sure that
block is not GC'd. Once finish testing I will post it.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=22065
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug c/22065] -fdump-tree-original causes static function to emitted with the same name
[not found] <bug-22065-6528@http.gcc.gnu.org/bugzilla/>
` (5 preceding siblings ...)
2005-10-16 17:01 ` pinskia at gcc dot gnu dot org
@ 2005-10-16 18:52 ` pinskia at gcc dot gnu dot org
2005-10-23 0:04 ` pinskia at gcc dot gnu dot org
7 siblings, 0 replies; 10+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-10-16 18:52 UTC (permalink / raw)
To: gcc-bugs
------- Comment #8 from pinskia at gcc dot gnu dot org 2005-10-16 18:52 -------
The patch still does not work but here is the reduced testcase:
typedef long unsigned int size_t;
void * __wrap_malloc (size_t c) __attribute__ (( alias ("malloc") ));
This on x86_64-pc-linux-gnu, I will still look into it.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=22065
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug c/22065] -fdump-tree-original causes static function to emitted with the same name
[not found] <bug-22065-6528@http.gcc.gnu.org/bugzilla/>
` (6 preceding siblings ...)
2005-10-16 18:52 ` pinskia at gcc dot gnu dot org
@ 2005-10-23 0:04 ` pinskia at gcc dot gnu dot org
7 siblings, 0 replies; 10+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-10-23 0:04 UTC (permalink / raw)
To: gcc-bugs
------- Comment #9 from pinskia at gcc dot gnu dot org 2005-10-23 00:04 -------
No longer working on this, laptop is dead.
--
pinskia at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
AssignedTo|pinskia at gcc dot gnu dot |unassigned at gcc dot gnu
|org |dot org
Status|ASSIGNED |NEW
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=22065
^ permalink raw reply [flat|nested] 10+ messages in thread
[parent not found: <bug-22065-4@http.gcc.gnu.org/bugzilla/>]
* [Bug c/22065] New: -fdump-tree-original causes static function to emitted with the same name
@ 2005-06-14 17:39 pinskia at gcc dot gnu dot org
2005-06-17 10:25 ` [Bug c/22065] " belyshev at depni dot sinp dot msu dot ru
0 siblings, 1 reply; 10+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-06-14 17:39 UTC (permalink / raw)
To: gcc-bugs
Combining the following C functions and using -fdump-tree-original causes the static function with
the same name to emitted with the same name instead of with an unique number.
--- file1.c ---
static void f(){}
void g(){f();}
--- cut ---
--- file2.c ---
static void f(){}
void h(){f();}
--- cut ---
Compile this with "-combine -fdump-tree-original file1.c file2.c -c" and see that this fails to assemble.
Some analysis from Caroline:
If you call c_genericize with the flag for the dump turned on, it calls
DECL_ASSEMBLER_NAME (it ought to call DECL_NAME). The problem
I saw was: I was compiling a bunch of files at the same time (a SPEC
benchmark). Several of the C files called the same header file, which had
a tiny function defined inside it. The function name *should* have gotten
a number appended to the end of it so that each occurrence of it in the
assembly file was unique. However the premature call to DECL_ASSEMBLER_NAME
in c_genericize (when dump is turned on) meant the context was not
properly set at the time DECL_ASSEMBLER_NAME was called, which in
turn meant the uniquifying numbers were not appended to the function name,
which resulted in multiple functions with the same name in the .s file, which caused
the linker to complain vociferously.
I generated the testcase from her description of the bug.
--
Summary: -fdump-tree-original causes static function to emitted
with the same name
Product: gcc
Version: 4.1.0
Status: UNCONFIRMED
Keywords: wrong-code
Severity: normal
Priority: P2
Component: c
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: pinskia at gcc dot gnu dot org
CC: ctice at apple dot com,gcc-bugs at gcc dot gnu dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=22065
^ permalink raw reply [flat|nested] 10+ messages in thread
end of thread, other threads:[~2011-11-07 19:32 UTC | newest]
Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
[not found] <bug-22065-6528@http.gcc.gnu.org/bugzilla/>
2005-10-16 3:48 ` [Bug c/22065] -fdump-tree-original causes static function to emitted with the same name pinskia at gcc dot gnu dot org
2005-10-16 3:50 ` pinskia at gcc dot gnu dot org
2005-10-16 4:27 ` pinskia at gcc dot gnu dot org
2005-10-16 16:18 ` pinskia at gcc dot gnu dot org
2005-10-16 16:45 ` pinskia at gcc dot gnu dot org
2005-10-16 17:01 ` pinskia at gcc dot gnu dot org
2005-10-16 18:52 ` pinskia at gcc dot gnu dot org
2005-10-23 0:04 ` pinskia at gcc dot gnu dot org
[not found] <bug-22065-4@http.gcc.gnu.org/bugzilla/>
2011-11-07 19:32 ` belyshev at depni dot sinp.msu.ru
2005-06-14 17:39 [Bug c/22065] New: " pinskia at gcc dot gnu dot org
2005-06-17 10:25 ` [Bug c/22065] " belyshev at depni dot sinp dot msu 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).