Bug 38054 - Assertion failed in change_decl_assembler_name()
Summary: Assertion failed in change_decl_assembler_name()
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: target (show other bugs)
Version: 4.4.0
: P3 normal
Target Milestone: 4.3.3
Assignee: Danny Smith
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-11-07 18:43 UTC by Dmitry Gorbachev
Modified: 2008-12-04 07:16 UTC (History)
4 users (show)

See Also:
Host: i686-pc-linux-gnu
Target: i386-pc-mingw32
Build: i686-pc-linux-gnu
Known to work:
Known to fail:
Last reconfirmed: 2008-11-09 00:41:29


Attachments
Preprocessed source (217.28 KB, application/x-bzip)
2008-11-07 18:45 UTC, Dmitry Gorbachev
Details
Smaller test case (101 bytes, text/plain)
2008-11-24 10:24 UTC, KJK::Hyperion
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Dmitry Gorbachev 2008-11-07 18:43:54 UTC
mingw32-c++ (GCC) 4.4.0 20081031 (experimental)

internal compiler error: in change_decl_assembler_name, at cgraph.c:1252

C++ source is here: <http://svn.reactos.org/svn/reactos/trunk/reactos/base/shell/explorer/desktop/desktop.cpp?revision=34284&content-type=text%2Fplain>
Comment 1 Dmitry Gorbachev 2008-11-07 18:45:13 UTC
Created attachment 16632 [details]
Preprocessed source
Comment 2 Danny Smith 2008-11-09 08:20:47 UTC
This a target bug (stdcall symbol name decorati0on on windows targets)
Comment 3 Danny Smith 2008-11-09 08:24:54 UTC
Patch at:
http://gcc.gnu.org/ml/gcc-patches/2008-11/msg00321.html
Comment 4 Dmitry Gorbachev 2008-11-09 11:30:38 UTC
(In reply to comment #3)

Ok, thanks.
Comment 5 Danny Smith 2008-11-11 06:27:48 UTC
(In reply to comment #3)
> Patch at:
> http://gcc.gnu.org/ml/gcc-patches/2008-11/msg00321.html
> 

That patch also fixes the FAIL of testsuite\g++.old-deja\g++.dg\other>g++ pr35504.C .  Currently it fails on mingw32 and cygwin with:
 
Warning: resolving non-virtual thunk to c3::method5()@4 by linking to non-virtual thunk to c3::method5()
Use --enable-stdcall-fixup to disable these warnings
Use --disable-stdcall-fixup to disable these fixups
c:\tmp/ccisCRqc.o:pr35504.C:(.rdata$_ZTV2c3[vtable for c3]+0x44): undefined reference to `@_ZThn8_N2c37method4Ev@4'
collect2: ld returned 1 exit status 
Comment 6 Dmitry Gorbachev 2008-11-13 20:21:39 UTC
(In reply to comment #5)

GCC 4.3.2 suffers from the same bug.
Comment 7 KJK::Hyperion 2008-11-24 10:24:58 UTC
Created attachment 16756 [details]
Smaller test case

gcc -c -v -funit-at-a-time -nostdinc testcase.c

Using built-in specs.
Target: mingw32
Configured with: ../gcc-4.1.3/configure --prefix=/gcc-4.1.3 --with-gcc --with-gnu-ld --with-gnu-as --host=mingw32 --target=mingw32 --build=mingw32 --enable-languages=c,c++ --enable-checking=release --enable-threads=win32 --disable-win32-registry --disable-nls --disable-shared
Thread model: win32
gcc version 4.1.3 20071015 (prerelease)
 c:/users/hyperion/rosbe/4.1.3/bin/../libexec/gcc/mingw32/4.1.3/cc1.exe -quiet -nostdinc -v -iprefix c:\users\hyperion\rosbe\4.1.3\bin\../lib/gcc/mingw32/4.1.3/ testcase.c -quiet -dumpbase testcase.c -auxbase testcase -version -funit-at-a-time -o C:\Users\Hyperion\AppData\Local\Temp/cczKM08O.s
#include "..." search starts here:
#include <...> search starts here:
 C:/Users/Hyperion/RosBE/4.1.3/include
 C:/Users/Hyperion/RosBE/4.1.3/lib/gcc/mingw32/4.1.3/include
End of search list.
GNU C version 4.1.3 20071015 (prerelease) (mingw32)
	compiled by GNU C version 4.1.3 20071015 (prerelease).
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
Compiler executable checksum: 3f527ff7c87fdc28aecf612037bc62b2
testcase.c: In function 'y':
testcase.c:10: warning: y renamed after being referenced in assembly
 c:/users/hyperion/rosbe/4.1.3/bin/../lib/gcc/mingw32/4.1.3/../../../../mingw32/bin/as.exe -o testcase.o C:\Users\Hyperion\AppData\Local\Temp/cczKM08O.s
Comment 8 KJK::Hyperion 2008-11-24 10:29:08 UTC
I have added a test case that shows a closely related issue with nested functions, -funit-at-a-time and unreferenced file-scope externs (yes, if you remove "int x = 0;" the warning goes away)

The "%D renamed after being referenced in assembly" warning cannot be disabled, either, so this is a bit problematic for sources compiled with -Werror
Comment 9 Dmitry Gorbachev 2008-11-26 00:14:27 UTC
GCC 4.3.2 and 4.4.0 compile the above testcase without warnings.
Comment 10 dannysmith@gcc.gnu.org 2008-12-02 08:03:41 UTC
Subject: Bug 38054

Author: dannysmith
Date: Tue Dec  2 08:02:07 2008
New Revision: 142347

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=142347
Log:
        PR target/38054
	* config/i386/winnt.c (i386_pe_encode_section_info): Condition stdcall
	decoration of function RTL names here on Ada language.

Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/config/i386/winnt.c

Comment 11 Danny Smith 2008-12-02 08:05:35 UTC
I have committed a patch to 4.4.0  to fix  bug in compilation of desktop.cpp
Comment 12 dannysmith@gcc.gnu.org 2008-12-04 07:14:31 UTC
Subject: Bug 38054

Author: dannysmith
Date: Thu Dec  4 07:13:05 2008
New Revision: 142429

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=142429
Log:
	Backport from mainline:
        PR target/38054
	* config/i386/winnt.c (i386_pe_encode_section_info): Condition stdcall
	decoration of function RTL names here on Ada language.

Modified:
    branches/gcc-4_3-branch/gcc/ChangeLog
    branches/gcc-4_3-branch/gcc/config/i386/winnt.c

Comment 13 Danny Smith 2008-12-04 07:16:17 UTC
Fixed in 4.3.3