[Bug c/38269] New: Segmentation fault in main_block_label when using -fno-unit-at-a-time and precompiled headers containing inline functions

2008-11-25 Thread hackbunny at reactos dot com
Save the attachments (pin.c and ntoskrnl.h) to the same directory. Then run the
following commands:

gcc -o ntoskrnl.h.gch -I. -fno-unit-at-a-time -Os ntoskrnl.h
gcc -v -o pin.o -I. -fno-unit-at-a-time -Os -c pin.c

The latter will print the following:

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
-v -I. -iprefix c:\users\hyperion\rosbe\4.1.3\bin\../lib/gcc/mingw32/4.1.3/
pin.c -quiet -dumpbase pin.c -auxbase-strip pin.o -Os -version
-fno-unit-at-a-time -o C:\Users\Hyperion\AppData\Local\Temp/ccphrNAF.s
ignoring nonexistent directory C:/MSYS/gcc-4.1.3/include
ignoring nonexistent directory /gcc-4.1.3/include
ignoring nonexistent directory
C:/MSYS/gcc-4.1.3/lib/gcc/mingw32/4.1.3/include
ignoring nonexistent directory C:/MSYS/gcc-4.1.3/mingw32/include
ignoring nonexistent directory /mingw/include
#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
 c:/users/hyperion/rosbe/4.1.3/bin/../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


Very often (but not always), when executing the second command line, cc1.exe
will ICE with the following message:

ntoskrnl.h: In function 'ExAllocateFromNPagedLookasideList':
ntoskrnl.h:56: 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.

I attached a debugger to cc1.exe, and resolved the symbols by hand to the
following call stack:

143e04  _main_block_label
143fa1  _cleanup_dead_labels
124461  _execute_cleanup_cfg_post_optimizing
11ed04  _execute_one_pass
11ee3b  _execute_pass_list
11ee4f  _execute_pass_list
1245fe  _tree_rest_of_compilation
09194   _c_expand_body
4eecb   _cgraph_expand_function
4efa9   _cgraph_assemble_pending_functions
50125   _cgraph_finalize_function
09573   _finish_function
3fd4e   _c_parser_declaration_or_fndef
4132e   _c_parser_external_declaration
41f1d   _c_gimplify_expr
305c4   _c_common_post_options
f84bc   _toplev_main
461f7   _main
0124b   ___mingw_CRTStartup
01298   _mainCRTStartup


Note that I'm forced to use -fno-unit-at-a-time because of an issue related to
PR 17982 and PR 38054


-- 
   Summary: Segmentation fault in main_block_label when using -fno-
unit-at-a-time and precompiled headers containing inline
functions
   Product: gcc
   Version: 4.1.3
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: hackbunny at reactos dot com
 GCC build triplet: mingw32
  GCC host triplet: mingw32
GCC target triplet: mingw32


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



[Bug c/38269] Segmentation fault in main_block_label when using -fno-unit-at-a-time and precompiled headers containing inline functions

2008-11-25 Thread hackbunny at reactos dot com


--- Comment #1 from hackbunny at reactos dot com  2008-11-25 21:56 ---
Created an attachment (id=16770)
 -- (http://gcc.gnu.org/bugzilla/attachment.cgi?id=16770action=view)
test case (1 of 2)


-- 


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



[Bug c/38269] Segmentation fault in main_block_label when using -fno-unit-at-a-time and precompiled headers containing inline functions

2008-11-25 Thread hackbunny at reactos dot com


--- Comment #2 from hackbunny at reactos dot com  2008-11-25 21:56 ---
Created an attachment (id=16771)
 -- (http://gcc.gnu.org/bugzilla/attachment.cgi?id=16771action=view)
test case (2 of 2)


-- 


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



[Bug target/38269] Segmentation fault in main_block_label when using -fno-unit-at-a-time and precompiled headers containing inline functions

2008-11-25 Thread hackbunny at reactos dot com


--- Comment #4 from hackbunny at reactos dot com  2008-11-25 22:12 ---
Yes and no, we are resisting upgrading due to PR 31707 (which we are attempting
to workaround, and the workaround led to this bug...). I will try ASAP anyway


-- 


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



[Bug target/38054] Assertion failed in change_decl_assembler_name()

2008-11-24 Thread hackbunny at reactos dot com


--- Comment #7 from hackbunny at reactos dot com  2008-11-24 10:24 ---
Created an attachment (id=16756)
 -- (http://gcc.gnu.org/bugzilla/attachment.cgi?id=16756action=view)
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


-- 


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



[Bug target/38054] Assertion failed in change_decl_assembler_name()

2008-11-24 Thread hackbunny at reactos dot com


--- Comment #8 from hackbunny at reactos dot com  2008-11-24 10:29 ---
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


-- 

hackbunny at reactos dot com changed:

   What|Removed |Added

 CC||hackbunny at reactos dot com


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



[Bug middle-end/17982] stop calling assemble_external before final assembly output time

2008-11-23 Thread hackbunny at reactos dot com


--- Comment #31 from hackbunny at reactos dot com  2008-11-24 04:32 ---
Created an attachment (id=16755)
 -- (http://gcc.gnu.org/bugzilla/attachment.cgi?id=16755action=view)
testcase.c:10: warning: y renamed after being referenced in assembly

Compile test case with -funit-at-a-time

gcc -v:

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)


-- 


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



[Bug middle-end/17982] stop calling assemble_external before final assembly output time

2008-11-23 Thread hackbunny at reactos dot com


--- Comment #32 from hackbunny at reactos dot com  2008-11-24 04:32 ---
I've been told that this is related to the test case I just attached


-- 

hackbunny at reactos dot com changed:

   What|Removed |Added

 CC||hackbunny at reactos dot com


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



[Bug c++/37981] New: internal compiler error: in rest_of_handle_final, at final.c:3942

2008-10-31 Thread hackbunny at reactos dot com
See attached preprocessed source and compiler output


-- 
   Summary: internal compiler error: in rest_of_handle_final, at
final.c:3942
   Product: gcc
   Version: 4.1.3
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: hackbunny at reactos dot com
 GCC build triplet: mingw32
  GCC host triplet: mingw32
GCC target triplet: mingw32


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



[Bug c++/37981] internal compiler error: in rest_of_handle_final, at final.c:3942

2008-10-31 Thread hackbunny at reactos dot com


--- Comment #1 from hackbunny at reactos dot com  2008-10-31 16:24 ---
Created an attachment (id=16598)
 -- (http://gcc.gnu.org/bugzilla/attachment.cgi?id=16598action=view)
compiler output


-- 


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



[Bug c++/37981] internal compiler error: in rest_of_handle_final, at final.c:3942

2008-10-31 Thread hackbunny at reactos dot com


--- Comment #2 from hackbunny at reactos dot com  2008-10-31 16:25 ---
Created an attachment (id=16599)
 -- (http://gcc.gnu.org/bugzilla/attachment.cgi?id=16599action=view)
preprocessed input


-- 


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



[Bug c++/37981] internal compiler error: in rest_of_handle_final, at final.c:3942

2008-10-31 Thread hackbunny at reactos dot com


--- Comment #3 from hackbunny at reactos dot com  2008-10-31 16:31 ---
Created an attachment (id=16600)
 -- (http://gcc.gnu.org/bugzilla/attachment.cgi?id=16600action=view)
compiler output (PCH disabled)


-- 

hackbunny at reactos dot com changed:

   What|Removed |Added

  Attachment #16598|0   |1
is obsolete||


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



[Bug c++/37981] internal compiler error: in rest_of_handle_final, at final.c:3942

2008-10-31 Thread hackbunny at reactos dot com


--- Comment #4 from hackbunny at reactos dot com  2008-10-31 16:34 ---
Created an attachment (id=16601)
 -- (http://gcc.gnu.org/bugzilla/attachment.cgi?id=16601action=view)
preprocessed input (PCH disabled)

sorry about compression, the file is too big to attach


-- 

hackbunny at reactos dot com changed:

   What|Removed |Added

  Attachment #16599|0   |1
is obsolete||


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



[Bug c/31707] New: Spurious 'variable' may be used uninitialized in this function warnings when using __builtin_setjmp

2007-04-25 Thread hackbunny at reactos dot com
Command line: gcc -c lib\rtl\workitem.c -o obj-i386\lib\rtl\workitem.o
-Iobj-i386\lib\rtl -Ilib\rtl -D__USE_W32API -D_NTOSKRNL_ -D__NO_CTYPE_INLINES
-DNO_RTL_INLINES -D_NTSYSTEM_ -D_NTDLLBUILD_ -Iobj-i386\lib\rtl -I. -Iinclude
-Iinclude\psdk -Iinclude\crt -Iinclude\ddk -Iinclude\GL -Iinclude\ndk
-Iinclude\reactos -Iinclude\reactos\libs -D_M_IX86 -D_X86_ -D__i386__
-D_REACTOS_ -DDBG -D_SEH_ENABLE_TRACE -Wall -march=pentium -Wpointer-arith -Os
-Wno-strict-aliasing -ftracer -momit-leaf-frame-pointer
-mpreferred-stack-boundary=2 -g -pipe -Werror -fno-optimize-sibling-calls
-save-temps -v

Output:
gcc: warning: -pipe ignored because -save-temps specified
Using built-in specs.
Target: mingw32
Configured with: ../gcc-4.2.0/configure --host=mingw32 --target=mingw32
--prefix=/mingw --with-gnu-as --with-gnu-ld --enable-threads --disable-nls
--enable-languages=c,c++ --enable-threads=win32 --disable-win32-registry
--disable-win32-registry --disable-shared
Thread model: win32
gcc version 4.2.0 20070415 (prerelease)
 d:/rosbe/4.2.0/bin/../libexec/gcc/mingw32/4.2.0/cc1.exe -E -quiet -v
-Iobj-i386\lib\rtl -Ilib\rtl -Iobj-i386\lib\rtl -I. -Iinclude -Iinclude\psdk
-Iinclude\crt -Iinclude\ddk -Iinclude\GL -Iinclude\ndk -Iinclude\reactos
-Iinclude\reactos\libs -iprefix d:\rosbe\4.2.0\bin\../lib/gcc/mingw32/4.2.0/
-D__USE_W32API -D_NTOSKRNL_ -D__NO_CTYPE_INLINES -DNO_RTL_INLINES -D_NTSYSTEM_
-D_NTDLLBUILD_ -D_M_IX86 -D_X86_ -D__i386__ -D_REACTOS_ -DDBG
-D_SEH_ENABLE_TRACE lib\rtl\workitem.c -march=pentium -momit-leaf-frame-pointer
-mpreferred-stack-boundary=2 -Wall -Wpointer-arith -Wno-strict-aliasing -Werror
-ftracer -fno-optimize-sibling-calls -fworking-directory -Os -fpch-preprocess
-o workitem.i
ignoring nonexistent directory c:/mingw/include
ignoring nonexistent directory /mingw/include
ignoring nonexistent directory c:/mingw/lib/gcc/mingw32/4.2.0/include
ignoring nonexistent directory c:/mingw/mingw32/include
ignoring nonexistent directory /mingw/include
#include ... search starts here:
#include ... search starts here:
 obj-i386/lib/rtl
 lib/rtl
 obj-i386/lib/rtl
 .
 include
 include/psdk
 include/crt
 include/ddk
 include/GL
 include/ndk
 include/reactos
 include/reactos/libs
 D:/RosBE/4.2.0/include
 D:/RosBE/4.2.0/lib/gcc/mingw32/4.2.0/include
 d:/rosbe/4.2.0/bin/../lib/gcc/mingw32/4.2.0/include
End of search list.
 d:/rosbe/4.2.0/bin/../libexec/gcc/mingw32/4.2.0/cc1.exe -fpreprocessed
workitem.i -quiet -dumpbase workitem.c -march=pentium -momit-leaf-frame-pointer
-mpreferred-stack-boundary=2 -auxbase-strip obj-i386\lib\rtl\workitem.o -g -Os
-Wall -Wpointer-arith -Wno-strict-aliasing -Werror -version -ftracer
-fno-optimize-sibling-calls -o workitem.s
GNU C version 4.2.0 20070415 (prerelease) (mingw32)
compiled by GNU C version 4.2.0 20070415 (prerelease).
GGC heuristics: --param ggc-min-expand=99 --param ggc-min-heapsize=131002
Compiler executable checksum: 232281512bb28abd92c2d204d6f594e1
cc1.exe: warnings being treated as errors
lib\rtl\workitem.c: In function 'foo':
lib\rtl\workitem.c:21: warning: '_SEHPortableFrame' may be used uninitialized
in this function
lib\rtl\workitem.c:21: warning: '_SEHState' may be used uninitialized in this
function


-- 
   Summary: Spurious 'variable' may be used uninitialized in this
function warnings when using __builtin_setjmp
   Product: gcc
   Version: 4.2.0
Status: UNCONFIRMED
  Severity: major
  Priority: P3
 Component: c
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: hackbunny at reactos dot com
  GCC host triplet: mingw32
GCC target triplet: mingw32


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



[Bug c/31707] Spurious 'variable' may be used uninitialized in this function warnings when using __builtin_setjmp

2007-04-25 Thread hackbunny at reactos dot com


--- Comment #1 from hackbunny at reactos dot com  2007-04-25 23:28 ---
Created an attachment (id=13442)
 -- (http://gcc.gnu.org/bugzilla/attachment.cgi?id=13442action=view)
Preprocessor output


-- 


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



[Bug c/31707] Spurious 'variable' may be used uninitialized in this function warnings when using __builtin_setjmp

2007-04-25 Thread hackbunny at reactos dot com


--- Comment #2 from hackbunny at reactos dot com  2007-04-25 23:29 ---
Created an attachment (id=13443)
 -- (http://gcc.gnu.org/bugzilla/attachment.cgi?id=13443action=view)
GIMPLE source for the test case


-- 


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



[Bug c/31707] Spurious 'variable' may be used uninitialized in this function warnings when using __builtin_setjmp

2007-04-25 Thread hackbunny at reactos dot com


--- Comment #3 from hackbunny at reactos dot com  2007-04-25 23:30 ---
Created an attachment (id=13444)
 -- (http://gcc.gnu.org/bugzilla/attachment.cgi?id=13444action=view)
Final tree dump for the test case

By going through the tree dump, it appears the warning has no reason to be


-- 


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



[Bug c/31707] Spurious 'variable' may be used uninitialized in this function warnings when using __builtin_setjmp

2007-04-25 Thread hackbunny at reactos dot com


--- Comment #4 from hackbunny at reactos dot com  2007-04-25 23:33 ---
A couple more notes:
 * no warning if setjmp is used instead of __builtin_setjmp
 * no warning if the call to bar() is removed
 * no warning in GCC 4.1.2


-- 

hackbunny at reactos dot com changed:

   What|Removed |Added

 CC||hackbunny at reactos dot com


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