This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/64501] New: Unreachable catch BB for try blocks that cannot create an exception of specific type
- From: "marxin at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Mon, 05 Jan 2015 16:18:22 +0000
- Subject: [Bug c++/64501] New: Unreachable catch BB for try blocks that cannot create an exception of specific type
- Auto-submitted: auto-generated
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64501
Bug ID: 64501
Summary: Unreachable catch BB for try blocks that cannot create
an exception of specific type
Product: gcc
Version: 5.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: marxin at gcc dot gnu.org
CC: hubicka at gcc dot gnu.org
Hello.
I've been wondering if following catch branch in main can be optimized out as
unreachable:
void linker_error (void);
void t()
{
try
{
throw (char)(1);
}
catch (char t) {}
}
int
main()
{
try
{
t();
}
catch (void *v)
{
linker_error ();
}
}
As there's no possible emission of an exception of void*, can by call of
linker_error removed?
Thanks,
Martin