lkml.org 
[lkml]   [1999]   [Jun]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: egcs-1.1.2 ping bug also causes miscompilation of pcbit isdn drive
Date
I am posting this before somebody will jump to a conclusion that
"because egcs may have problems on Intel this implies that it will
have the same trouble on Alpha, or other processor, as well".

This is not a theoretical possibilty; I have seen this fallacy many
times in the past in various postings.

Lars Heete mailed me his tests cases which were supposed to demonstrate
the failure we are talking about. With egcs-1.1.2 on Alpha an output
from these samples, compiled with -O2 or with -O6 looks, like that:

Output should be 0x12345678
0x12345678 short 0x5678 to int 0x12345678
0x12345678 short 0x5678 to short[2] {0x5678, 0x1234}
0x12345678 char 0x78 to int 0x12345678
0x12345678 char 0x78 to char[4] {0x78, 0x56, 0x34, 0x12}
0x12345678 test_struct
Output should be 0x1234
0x1234 char 0x34 to char[2] {0x34, 0x12}
0x1234 char 0x34 to char[3] {0x34, 0x12, 0x00}
Assignments that work (variable doesn't fit into a register)
0x12345678 short to short[3]

Contrary to the last comment the variable in question does fit into
a register which happens to be a tad wider on Alpha. Also source
for these samples makes unwarranted assumptions which, but a pure luck,
happen to satisfied in some particular situation; this does not make
them any better C.

The above, of course, does not mean that egcs-1.1.2 on Alpha is perfect
but that its bugs are not necessarily the same as on Intel. :-)

Michal

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 13:52    [from the cache]
©2003-2011 Jasper Spaans