This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug other/49942] Wrong code generated for -O2 with target s390 on Linux
- From: "jakub at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Tue, 2 Aug 2011 13:37:09 +0000
- Subject: [Bug other/49942] Wrong code generated for -O2 with target s390 on Linux
- Auto-submitted: auto-generated
- References: <bug-49942-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49942
--- Comment #10 from Jakub Jelinek <jakub at gcc dot gnu.org> 2011-08-02 13:36:53 UTC ---
I think the testcase from your exec charset for Linux would map to:
struct oper { char *digits; char sign; };
struct oper oper0 = {"\xf9\xf0\xf0\xf0\xf0\xf0\xf0\xf0\xf0", 'N'};
struct oper oper1 = {"\xf4\xf0\xf0\xf0\xf0\xf0\xf0\xf0\xf0", 'N'};
static int
comp (struct oper *op0, struct oper *op1)
{
int i;
__builtin_printf ("%s vs %s ", op0->digits, op1->digits);
for (i = 0; 9 > i; i++)
{
int diff = (0xff & op0->digits[i]) - (0xff & op1->digits[i]);
if (diff) return '`' == op0->sign ? (0 < diff ? -1 : 1) : (0 > diff ? -1
: 1);
}
return 0;
}
int
main ()
{
__builtin_printf (" is %d\n", comp (&oper0, &oper1));
__builtin_printf (" is %d\n", comp (&oper1, &oper0));
return 0;
}
('0' through '9' are '\xf0' through '\xf9' apparently, and '+' is 'N' and '-'
is '`'. If I run this on Linux, I still get the expected results.
No idea about if zVM doesn't set up something differently etc., clearly it
works on Linux. Can you use a s390x-linux targetted compiler to compile code
for the VM at all, i.e. shouldn't that be a different target?