This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug rtl-optimization/85393] New: [8 Regression] Miscompilation with hot/cold partitioning starting with r254832
- From: "jakub at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Fri, 13 Apr 2018 10:04:59 +0000
- Subject: [Bug rtl-optimization/85393] New: [8 Regression] Miscompilation with hot/cold partitioning starting with r254832
- Auto-submitted: auto-generated
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85393
Bug ID: 85393
Summary: [8 Regression] Miscompilation with hot/cold
partitioning starting with r254832
Product: gcc
Version: 8.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: rtl-optimization
Assignee: unassigned at gcc dot gnu.org
Reporter: jakub at gcc dot gnu.org
Target Milestone: ---
test.C:
#include <stdexcept>
#include <vector>
void foo (char const *s);
struct S {
~S () noexcept (false) {
throw std::runtime_error ("foo");
}
};
int
main(int argc, char *argv[])
{
std::vector <std::vector <char>> args;
try
{
{
S k;
foo ("A");
}
if (argv)
throw std::runtime_error ("foo");
args.push_back ({});
}
catch (std::runtime_error const& e)
{}
}
test2.C:
void foo (char const *) {}
g++ -g -O2 -o test{,.C,2.C}
segfaults because vector dtor is called with NULL this. My bisection points to
r254832, Marek's to r250360 (I've used 7.x STL headers, dunno what has Marek
used). In any case, the segfault goes away with
-fno-reorder-blocks-and-partition, and the only r254832 vs. r254831 differences
in *.optimized dump I see are branch probabilities, so it must be RTL
optimization related (or target issue).