I am developing a test generator for in house compilers and have come across a
difference where gcc does not agree with our compilers or the Microsoft
compiler.
The result t1_2a of the expression is what differs between gcc and other
compilers.
This is on gcc (GCC) 3.4.6 20060404 (Red Hat 3.4.6-9), and does not matter what
the platform is.
Compiled with:
$ gcc4 test.c -o test.exe
$ ./test.exe
Error:
t1_2a ffffffff
t1_2b 22a8b02e
t1_2c 0
Working:
t2_2a 0
t2_2b 0
When compared to running on Visual Studio:
$ cl test.c
Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 14.00.50727.762 for
80x86
Copyright (C) Microsoft Corporation. All rights reserved.
test.c
Microsoft (R) Incremental Linker Version 8.00.50727.762
Copyright (C) Microsoft Corporation. All rights reserved.
/out:test.exe
test.obj
$ ./test.exe
Error:
t1_2a 0
t1_2b 22a8b02e
t1_2c 0
Working:
t2_2a 0
t2_2b 0
--
Summary: Expressions result is wrong
Product: gcc
Version: 4.1.2
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: peter at xmos dot com
GCC build triplet: gcc version 4.1.2 20070626 (Red Hat 4.1.2-14)
GCC host triplet: Linux 2.6.9-67.ELsmp #1 SMP Wed Nov 7 13:56:44 EST 2007
x86_64 x
GCC target triplet: Target: x86_64-redhat-linux
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36077