Skip to content

Infinite loop in reassociate (with -ffast-math) #33425

@llvmbot

Description

@llvmbot
Bugzilla Link 34078
Resolution FIXED
Resolved on Sep 05, 2017 14:35
Version 4.0
OS Linux
Blocks #33196
Attachments reduced .bc file from bugpoint, bugpoint output to terminal
Reporter LLVM Bugzilla Contributor
CC @zmodem,@hfinkel,@RKSimon,@rotateright
Fixed by commit(s) 311554, 311603

Extended Description

clang++ hangs indefinitely when compiling the following code with -O2 -ffast-math

#include
void f(double A) {
double B = 1. - A - pow(A, 2) / 2.;
std::complex C = B + B;
std::complex D = 1. / C;
}

or the following code with -O1 -ffast-math

#include
void f(double A) {
double B = 1. - A - pow(A, 2) / 2.;
std::complex C = B + B;
}

(I originally observed the bug while compiling https://github.com/laurentkneip/opengv/blob/master/src/math/roots.cpp, and reduced).

Bugpoint suggests it is the reassociate pass. Reduced output attached.

Metadata

Metadata

Assignees

Labels

bugzillaIssues migrated from bugzilla

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions