Skip to content

Commit

Permalink
Merge pull request #5924 from MartinNowak/fix16225
Browse files Browse the repository at this point in the history
fix Issue 16225 - [REG 2.068] Internal error cod1.c 1338 with -O
  • Loading branch information
MartinNowak committed Jul 9, 2016
2 parents a89a9eb + ebbb2c6 commit 8a4a90f
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/backend/cod1.c
Expand Up @@ -1359,7 +1359,8 @@ code *getlvalue(code *pcs,elem *e,regm_t keepmsk)
if (sz == 1)
{ /* Don't use SI or DI for this variable */
s->Sflags |= GTbyte;
if (e->EV.sp.Voffset > 1)
if (e->EV.sp.Voffset > 1 ||
I64) // could work if restrict reg to AH,BH,CH,DH
s->Sflags &= ~GTregcand;
}
else if (e->EV.sp.Voffset)
Expand Down
14 changes: 14 additions & 0 deletions test/compilable/test16225.d
@@ -0,0 +1,14 @@
// REQUIRED_ARGS: -O -m64
// PERMUTE_ARGS:

// https://issues.dlang.org/show_bug.cgi?id=16225

struct C
{
hash_t foo( )
{
int y;
return ((cast(ubyte*)&y)[1]);
}
}

0 comments on commit 8a4a90f

Please sign in to comment.