Bug 41774 - ice: vector VEC(visibility,base) pop domain error, in pop_visibility at c-pragma.c:757
Summary: ice: vector VEC(visibility,base) pop domain error, in pop_visibility at c-pra...
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: c++ (show other bugs)
Version: unknown
: P3 normal
Target Milestone: ---
Assignee: Jakub Jelinek
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-10-21 00:34 UTC by John Regehr
Modified: 2009-11-02 13:58 UTC (History)
1 user (show)

See Also:
Host: i686-pc-linux-gnu
Target: i686-pc-linux-gnu
Build: i686-pc-linux-gnu
Known to work:
Known to fail:
Last reconfirmed:


Attachments
gcc45-pr41775.patch (1.84 KB, patch)
2009-10-21 08:01 UTC, Jakub Jelinek
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description John Regehr 2009-10-21 00:34:21 UTC
Obviously the input is malformed, but probably still should not ICE.

regehr@john-home:~/volatile/tmp208$ current-g++ -O small.cpp
small.cpp:2:27: internal compiler error: vector VEC(visibility,base) pop domain error, in pop_visibility at c-pragma.c:757
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.

regehr@john-home:~/volatile/tmp208$ current-g++ -v

Using built-in specs.
COLLECT_GCC=current-g++
COLLECT_LTO_WRAPPER=/home/regehr/z/tmp/gcc-r153044-install/libexec/gcc/i686-pc-linux-gnu/4.5.0/lto-wrapper
Target: i686-pc-linux-gnu
Configured with: ../configure --enable-lto --prefix=/home/regehr/z/tmp/gcc-r153044-install --program-prefix=r153044- --enable-languages=c,c++
Thread model: posix
gcc version 4.5.0 20091020 (experimental) (GCC) 

regehr@john-home:~/volatile/tmp208$ cat small.cpp

namespace std __attribute__ ((__visibility__ ("default"))) {
#pragma GCC visibility pop
Comment 1 Jakub Jelinek 2009-10-21 08:01:03 UTC
Created attachment 18849 [details]
gcc45-pr41775.patch

Fix I'm going to bootstrap/regtest.
Comment 2 Jakub Jelinek 2009-11-02 13:40:00 UTC
Subject: Bug 41774

Author: jakub
Date: Mon Nov  2 13:39:46 2009
New Revision: 153805

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=153805
Log:
	PR c++/41774
	* c-pragma.c (visstack): Change into vector of ints rather than
	enum symbol_visibility.
	(push_visibility): Add kind argument, push default_visibility together
	with kind.
	(pop_visibility): Add kind argument, return true if successful, fail
	if visibility stack is empty or if stack top is of different kind.
	(handle_pragma_visibility): Don't check length of visstack, instead
	call pop_visibility and issue diagnostics if it failed.  Pass 0
	as last argument to push_visibility and pop_visibility.
	* c-pragma.h (push_visibility): Add kind argument.
	(pop_visibility): Likewise.  Return bool instead of void.

	* name-lookup.c (handle_namespace_attrs): Pass 1 as last argument to
	push_visibility.
	* parser.c (cp_parser_namespace_definition): Pass 1 as argument to
	pop_visibility.
	* rtti.c (push_abi_namespace): Pass 2 as last argument to
	push_visibility.
	(pop_abi_namespace): Pass 2 as argument to pop_visibility.

	* g++.dg/ext/visibility/namespace3.C: New test.

Added:
    trunk/gcc/testsuite/g++.dg/ext/visibility/namespace3.C
Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/c-pragma.c
    trunk/gcc/c-pragma.h
    trunk/gcc/cp/ChangeLog
    trunk/gcc/cp/name-lookup.c
    trunk/gcc/cp/parser.c
    trunk/gcc/cp/rtti.c
    trunk/gcc/testsuite/ChangeLog

Comment 3 Jakub Jelinek 2009-11-02 13:58:34 UTC
Fixed.