Mail Archives: djgpp/2001/02/28/11:06:35
Michiel de Bondt (michielb AT sci DOT kun DOT nl) wrote:
: This is a multi-part message in MIME format.
: --------------524796937C70976A6AFCB0C8
: Content-Type: text/plain; charset=us-ascii
: Content-Transfer-Encoding: 7bit
: Hello djgpp-ers,
: I think I found a bug in gcc. But first, I had to mail the bug to this
: newsgroup. gcc allocates an occupied register for a computation. I made
: the following small sample file of the problem. You should cancel
: optimization, otherwise the problem does not occur due to removal of
: code.
: Best regard, Michiel de Bondt
: --------------524796937C70976A6AFCB0C8
: Content-Type: text/plain; charset=us-ascii;
: name="regs.cpp"
: Content-Transfer-Encoding: 7bit
: Content-Disposition: inline;
: filename="regs.cpp"
: // do not use optimization
: union intel
: {
: long e;
: short x;
: struct {
: char l;
: char h;
: } b;
: };
: int main ()
: {
: register union intel a __asm__ ("%eax");
: register union intel b __asm__ ("%ebx");
: register union intel c __asm__ ("%ecx");
: register union intel d __asm__ ("%edx");
: b.b.l++;
: }
: --------------524796937C70976A6AFCB0C8--
gcc 2.952 refuses to compile this (unless I turn on optimisations and
then the whole output is optimised away exactly as noted). What is the
problem?
Right,
MartinS
- Raw text -