Viewing Issue Simple Details Jump to Notes ] View Advanced ] Issue History ] Print ]
ID Category Severity Reproducibility Date Submitted Last Update
0000164 [libFirm] x86_64 backend (amd64) major always 2016-01-07 22:27 2016-01-10 23:43
Reporter Matze View Status public  
Assigned To Tron
Priority normal Resolution fixed  
Status resolved   Product Version 1.21.0
Summary 0000164: simple bswap asm block fails
Description The following simple program:

unsigned bswap32(unsigned x) {
    unsigned result;
    __asm__("bswap %0" : "=r" (result) : "0" (x));
    return result;
}

Gets miscompiled to:

_bswap32:
L0: /* Block BB[60:2] preds: none, freq: 1.000 */
#APP /* be_Asm T[109:10] t.c:3:2 */
    bswap %eax
#NO_APP
    ret /* amd64_ret X[117:18] t.c:4:2 */

It lacks a movl %edi, %eax before the bswap to get the argument into %eax.
Additional Information
Tags No tags attached.
Attached Files

- Relationships

-  Notes
(0000241)
Matze (administrator)
2016-01-07 22:28

My theory (before actually looking into it) would be that the should_be_same requirement isn't properly constructed.
(0000247)
Matze (administrator)
2016-01-10 23:43

This was fixed in revision ed63710be33ac674d5d094511414ebae40603b67

- Issue History
Date Modified Username Field Change
2016-01-07 22:27 Matze New Issue
2016-01-07 22:28 Matze Note Added: 0000241
2016-01-10 23:43 Matze Note Added: 0000247
2016-01-10 23:43 Matze Assigned To => Tron
2016-01-10 23:43 Matze Status new => resolved
2016-01-10 23:43 Matze Resolution open => fixed


Mantis 1.1.5[^]
Copyright © 2000 - 2008 Mantis Group
Powered by Mantis Bugtracker