FS#27790 - [gcc] 4.6.2 internal compiler error

Attached to Project: Arch Linux
Opened by Tomasz Mikolajczyk (tomaszmi) - Sunday, 01 January 2012, 12:11 GMT
Last edited by Allan McRae (Allan) - Monday, 23 January 2012, 04:06 GMT
Task Type Bug Report
Category Packages: Core
Status Closed
Assigned To Allan McRae (Allan)
Architecture i686
Severity High
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

Description:
gcc reports an internal compiler error when compiling a code from the attached file.

The gcc's output:
gcc_crash.cpp:16:7: warning: direct base ‘Foo’ inaccessible in ‘X’ due to ambiguity [enabled by default]
gcc_crash.cpp: In constructor ‘X::X()’:
gcc_crash.cpp:21:18: internal compiler error: in build_base_path, at cp/class.c:270
Please submit a full bug report,
with preprocessed source if appropriate.
See <https://bugs.archlinux.org/> for instructions.

Additional info:
* package version: 4.6.2 20111125 (prerelease)

Steps to reproduce:
Compile the attached file:
> g++ gcc_crash.cpp
This task depends upon

Closed by  Allan McRae (Allan)
Monday, 23 January 2012, 04:06 GMT
Reason for closing:  Upstream
Additional comments about closing:  See final comment
Comment by Allan McRae (Allan) - Sunday, 01 January 2012, 12:52 GMT
Probably not a bug as it is bad code... although the compiler should not crash..

test.cpp:16:7: warning: direct base ‘Foo’ inaccessible in ‘X’ due to ambiguity [enabled by default]

The warning is clear... you can not directly access Foo in X, but that is exactly what you do and how you get the crash. You probably want:

class X : virtual public Bar<Foo>
Comment by Tomasz Mikolajczyk (tomaszmi) - Sunday, 01 January 2012, 17:12 GMT
Of course the code is bad, but that is irrelevant here.
Comment by Tomasz Mikolajczyk (tomaszmi) - Wednesday, 04 January 2012, 21:25 GMT
Seems that the issue is already known:
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51614
Comment by Allan McRae (Allan) - Wednesday, 11 January 2012, 03:12 GMT Comment by Allan McRae (Allan) - Monday, 23 January 2012, 04:06 GMT
This is not being for 4.6 upstream (probably because the backport is not easy), so I will not be backporting the fix either.

Loading...