Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[RISCV] Infinite loop after D104581 #50550

Closed
topperc opened this issue Jul 24, 2021 · 3 comments
Closed

[RISCV] Infinite loop after D104581 #50550

topperc opened this issue Jul 24, 2021 · 3 comments
Labels
backend:RISC-V bugzilla Issues migrated from bugzilla

Comments

@topperc
Copy link
Collaborator

topperc commented Jul 24, 2021

Bugzilla Link 51206
Resolution FIXED
Resolved on Oct 11, 2021 20:29
Version trunk
OS All
Blocks #51489
CC @asb,@nathanchance,@nickdesaulniers
Fixed by commit(s) 54588bc 9ac5717

Extended Description

As reported in D104581 this test causes an infinite loop when compiled with -O2

char aspeed_set_pwm_port_fan_ctrl_priv_0_0,
aspeed_set_pwm_port_fan_ctrl_fan_ctrl;
pwm_store_period, pwm_store_dc_time_on;
pwm_store() {
pwm_store_period = aspeed_set_pwm_port_fan_ctrl_priv_0_0;
pwm_store_period += 1;
pwm_store_dc_time_on =
aspeed_set_pwm_port_fan_ctrl_fan_ctrl * pwm_store_period / 5;
if (pwm_store_dc_time_on)
aspeed_set_pwm_port_duty_rising_falling();
}

The combine from D104581 turns an any_extend into a sign_extend. This gets converted to a zero_extend as the sign bit of input is known to be 0. Then a setcc combine shrinks the setcc inputs back to the pre zero extended value. This allows the zero extend to become an any_extend again. Then the whole process starts over.

@topperc
Copy link
Collaborator Author

topperc commented Jul 28, 2021

Fixed by 54588bc

Also here's the link the ClangBuiltLinux report for this ClangBuiltLinux/linux#1431

@tstellar
Copy link
Collaborator

tstellar commented Aug 2, 2021

Merged: 9ac5717

@tstellar
Copy link
Collaborator

mentioned in issue #51489

@llvmbot llvmbot transferred this issue from llvm/llvm-bugzilla-archive Dec 11, 2021
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backend:RISC-V bugzilla Issues migrated from bugzilla
Projects
None yet
Development

No branches or pull requests

2 participants