Issue Details (XML | Word | Printable)

Key: PCC-336
Type: Bug Bug
Status: Resolved Resolved
Resolution: Fixed
Priority: Major Major
Assignee: Anders Magnusson
Reporter: Iain Hibbert
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
pcc

64-bit multiplication problem with -Wc,-xtemps

Created: 26/Apr/11 11:45 PM   Updated: 28/Apr/11 08:52 AM
Component/s: i386 target
Affects Version/s: None
Fix Version/s: None

File Attachments: 1. File mult.diff (1 kB)
2. File mult.s2 (0.7 kB)

Environment: NetBSD/i386


 Description  « Hide
The following example program

#include <stdio.h>

int
main(int ac, char *av[])
{
        long long ll;
        int i;

        ll = 1;
        for (i = 0; i < 4; i++) {
                ll = ll * 10;
                printf("%lld\n", ll);
        }
        return 0;
}

when compiled with -Wc,-xtemps produces the following output

10
30
30
30

which is clearly not correct. Looking at the assembler output, it uses registers to hold the
values which are probably being clobbered during the printf call?

 All   Comments   Change History      Sort Order: Ascending order - Click to sort in descending order
Iain Hibbert added a comment - 26/Apr/11 11:51 PM
actually, this might be related to http://pcc.ludd.ltu.se/jira/browse/PCC-289

Anders Magnusson added a comment - 27/Apr/11 09:46 PM
Hm, this doesn't fail for me with -current, even if 289 fails...? Can you recheck?

Iain Hibbert added a comment - 27/Apr/11 10:15 PM
Yes it seems to be fixed today..

by chance I still had an assembler output (-O2) from yesterday, have
attached the diff to todays output just in case you like to know what
changed, but otherwise this can be closed thanks

Anders Magnusson added a comment - 28/Apr/11 08:52 AM
It was a side-effect of the other register-clashing stuff.