https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117965
Bug ID: 117965
Summary: phiprop fails in some cases
Product: gcc
Version: 15.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: tree-optimization
Assignee: unassigned at gcc dot gnu.org
Reporter: rguenth at gcc dot gnu.org
Target Milestone: ---
While
#include <iostream>
#include <algorithm>
void clamp2(float num1) {
float low = -1.0f, high = 1.0f;
float num2,num3;
num1 = std::clamp(num1, low, high);
std::cout << num1 ;
}
is properly handled and cascades both derefs, the following only handles half
of the PHI derefs:
#include <iostream>
#include <algorithm>
void clamp2() {
float low = -1.0f, high = 1.0f;
float num1,num2,num3;
std::cin >> num1;
num1 = std::clamp(num1, low, high);
std::cout << num1 ;
}