[Issue 20441] Wrong code with -O -fPIC and pointer subtraction

d-bugmail at puremagic.com d-bugmail at puremagic.com
Thu Dec 12 11:02:20 UTC 2019


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

--- Comment #4 from Don <clugdbug at yahoo.com.au> ---
Wrong code is generated for any of the 'orthogonal' operators. This is another
example.

size_t roo(size_t r) { return r; }

void main ()
{
    size_t y = cast(size_t)("abc".ptr);
    assert ( (roo(y)^y) == 0);
}

Bug probably exists in cdorth() in cod2.d. As far as I can tell, that function
never generates RIP-relative addressing under any circumstances.

--


More information about the Digitalmars-d-bugs mailing list