-
Notifications
You must be signed in to change notification settings - Fork 35
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
GCC: ARITHMODE restore not dominated by save #53
Comments
margnus1
added a commit
to margnus1/otp
that referenced
this issue
Jul 16, 2015
Not only does Os not generate notably smaller code, it is also affected by a compiler bug that is dodged by O2 (adapteva/epiphany-sdk#53).
margnus1
added a commit
to margnus1/otp
that referenced
this issue
Aug 20, 2015
Not only does Os not generate notably smaller code, it is also affected by a compiler bug that is dodged by O2 (adapteva/epiphany-sdk#53).
Hi Magnus, Thank you for reporting. Yes, it is a bug. Fore future reference, here's a gcc test that also miscompiles because of it:
|
olajep
added a commit
to adapteva/epiphany-gcc
that referenced
this issue
Nov 4, 2015
Emit gen_save_config instruction right after the prologue so that the save-register is initialized in all blocks of the function. Problem described further here: adapteva/epiphany-sdk#53 Fixes: FAIL: gcc.c-torture/execute/struct-ret-1.c -Os execution test gcc/ * config/epiphany/epiphany.c (emit_set_fp_mode): If gen_save_config is emitted, insert it right after prologue. Signed-off-by: Ola Jeppsson <[email protected]>
olajep
changed the title
ARITHMODE restore not dominated by save
GCC: ARITHMODE restore not dominated by save
Apr 18, 2016
olajep
added a commit
to olajep/epiphany-gcc
that referenced
this issue
Dec 27, 2021
Emit gen_save_config instruction right after the prologue so that the save-register is initialized in all blocks of the function. Problem described further here: adapteva/epiphany-sdk#53 Fixes: FAIL: gcc.c-torture/execute/struct-ret-1.c -Os execution test gcc/ * config/epiphany/epiphany.c (emit_set_fp_mode): If gen_save_config is emitted, insert it right after prologue. Signed-off-by: Ola Jeppsson <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi! I believe I have stumbled upon a bug in your GCC backend:
The issue is easily spotted in the assembly output:
Control will flow from
_hash
to.L2
, never take the branch to.L3
, thus never savingconfig
tor16
, and proceed to restore ARITHMODE fromr16
(that remains unitinialized) before returning.You might ask, what's the issue? Well, consider that this function might set ARITHMODE to 010. The next time any function attempts integer multiplication, it will assert config bit 19, assuming that it results in an ARITHMODE of 100. In this case, though, that results in an ARITHMODE of 110, which on my E16G301 causes the "FPU/IALU2" pipeline to perform floating-point math.
The text was updated successfully, but these errors were encountered: