Skip to content

Commit d59f075

Browse files
WalterBrightthewilsonator
authored andcommitted
skip *2 optimization
1 parent 8874d41 commit d59f075

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

compiler/src/dmd/backend/cgelem.d

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6424,9 +6424,9 @@ private bool canHappenAfter(elem* a, elem* b)
64246424
/***************************************************
64256425
* See if we want conversion of (e = -e) to OPnegass
64266426
* Params:
6427-
* tym = the type of e in (e = -e)
6427+
* tym = the type of e in (e = -e)
64286428
* Returns:
6429-
* true if convert to OPnegass
6429+
* true if convert to OPnegass
64306430
*/
64316431
@trusted private
64326432
bool useOPnegass(tym_t tym)

compiler/src/dmd/backend/elem.d

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1243,7 +1243,7 @@ elem* el_convfloat(ref GlobalOptimizer go, elem* e)
12431243
private @trusted
12441244
elem* el_convreal(ref GlobalOptimizer go, elem* e)
12451245
{
1246-
//printf("el_convfloat()\n"); elem_print(e);
1246+
//printf("el_convreal()\n"); elem_print(e);
12471247
ubyte[32] buffer = void;
12481248

12491249
tym_t ty = e.Ety;
@@ -1487,7 +1487,8 @@ elem* el_convert(ref GlobalOptimizer go, elem* e)
14871487
* in this case, we preserve the constant 2.
14881488
*/
14891489
if (tyreal(e.Ety) && // don't bother with imaginary or complex
1490-
e.E2.Eoper == OPconst && el_toldoubled(e.E2) == 2.0L)
1490+
e.E2.Eoper == OPconst && el_toldoubled(e.E2) == 2.0L &&
1491+
!go.AArch64) // doesn't do the *2 optimization
14911492
{
14921493
e.E1 = el_convert(go, e.E1);
14931494
/* Don't call el_convert(e.E2), we want it to stay as a constant

0 commit comments

Comments
 (0)