This is the mail archive of the
gcc-prs@gcc.gnu.org
mailing list for the GCC project.
c++/8720: Internal compiler error by compilation of OpenOffice.org - bitwise or (3 operands)
- From: pmladek at suse dot cz
- To: gcc-gnats at gcc dot gnu dot org
- Date: 26 Nov 2002 17:42:08 -0000
- Subject: c++/8720: Internal compiler error by compilation of OpenOffice.org - bitwise or (3 operands)
- Reply-to: pmladek at suse dot cz
>Number: 8720
>Category: c++
>Synopsis: Internal compiler error by compilation of OpenOffice.org - bitwise or (3 operands)
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: unassigned
>State: open
>Class: ice-on-legal-code
>Submitter-Id: net
>Arrival-Date: Tue Nov 26 09:46:04 PST 2002
>Closed-Date:
>Last-Modified:
>Originator: Petr Mladek
>Release: gcc version 3.3 20021111 (experimental) (SuSE Linux)
>Organization:
>Environment:
SuSE linux, beta-i386
glibc-2.3.1
>Description:
I got an internal compiler error by compilation of
the OpenOffice.org.
I created a simple example with the same behaviour:
class A
{
public:
A(int nBits = ((int)0x8) | ((int)0x4) | ((int)0x2));
};
Some observations when the segfault does not occur:
- when 2 or 4 operands are used in bitwise operator
A(int nBits = ((int)0x8) | ((int)0x4) );
or
A(int nBits = ((int)0x8) | ((int)0x4) | ((int)0x2) | ((int)0x1) );
- when the braces around the casts are removed:
A(int nBits = (int)0x8 | (int)0x4 | (int)0x2 );
- when the casts are removed
A(int nBits = (0x8) | (0x4) | (0x2));
- when the whole expression is given into braces
A(int nBits = (((int)0x8) | ((int)0x4) | ((int)0x2)) );
OpenOffice.org uses this problematic pattern because
the constants are defined by #define and the cast is
not to (int) but to the (WinBits).
The complete error message is:
g++ -v -save-temps -c a.cxx
Reading specs from /usr/lib/gcc-lib/i486-suse-linux/3.3/specs
Configured with: ../configure --enable-threads=posix --prefix=/usr --with-local-
prefix=/usr/local --infodir=/usr/share/info --mandir=/usr/share/man --libdir=/us
r/lib --enable-languages=c,c++,f77,objc,java,ada --disable-checking --enable-lib
gcj --with-gxx-include-dir=/usr/include/g++ --with-slibdir=/lib --with-system-zl
ib --enable-shared --enable-__cxa_atexit i486-suse-linux
Thread model: posix
gcc version 3.3 20021111 (experimental) (SuSE Linux)
/usr/lib/gcc-lib/i486-suse-linux/3.3/cc1plus -E -D__GNUG__=3 -quiet -v -D__GNUC
__=3 -D__GNUC_MINOR__=3 -D__GNUC_PATCHLEVEL__=0 -D_GNU_SOURCE a.cxx a.ii
#include "..." search starts here:
#include <...> search starts here:
/usr/include/g++
/usr/include/g++/i486-suse-linux
/usr/include/g++/backward
/usr/local/include
/usr/lib/gcc-lib/i486-suse-linux/3.3/include
/usr/i486-suse-linux/include
/usr/include
End of search list.
/usr/lib/gcc-lib/i486-suse-linux/3.3/cc1plus -fpreprocessed a.ii -quiet -dumpba
se a.cxx -auxbase a -version -o a.s
GNU C++ version 3.3 20021111 (experimental) (SuSE Linux) (i486-suse-linux)
compiled by GNU C version 3.3 20021111 (experimental) (SuSE Linux).
a.cxx:4: internal compiler error: Neoprávněný přístup do paměti (SIGSEGV)
>How-To-Repeat:
g++ -c a.ii
>Fix:
>Release-Note:
>Audit-Trail:
>Unformatted:
----gnatsweb-attachment----
Content-Type: application/octet-stream; name="a.ii"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="a.ii"
IyAxICJhLmN4eCIKIyAxICI8YnVpbHQtaW4+IgojIDEgIjxjb21tYW5kIGxpbmU+IgojIDEgImEu
Y3h4IgpjbGFzcyBBCnsKcHVibGljOgogICAgQShpbnQgbkJpdHMgPSAoKGludCkweDgpIHwgKChp
bnQpMHg0KSB8ICgoaW50KTB4MikpOwp9Owo=