[Bug c/41750] gcc 4.5.0 miscompiles binutils

2009-10-19 Thread rguenth at gcc dot gnu dot org


--- Comment #1 from rguenth at gcc dot gnu dot org  2009-10-19 11:00 ---
Testcase required.


-- 

rguenth at gcc dot gnu dot org changed:

   What|Removed |Added

 Status|UNCONFIRMED |WAITING


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41750



[Bug c/41750] gcc 4.5.0 miscompiles binutils

2009-10-19 Thread rainer at emrich-ebersheim dot de


--- Comment #2 from rainer at emrich-ebersheim dot de  2009-10-19 11:43 
---
Subject: Re:  gcc 4.5.0 miscompiles binutils

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

rguenth at gcc dot gnu dot org schrieb:
 --- Comment #1 from rguenth at gcc dot gnu dot org  2009-10-19 11:00 
 ---
 Testcase required.
 
 

Richard, some advice how to create a testcase for this particular issue would
be
appreciated.

-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.10 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkrcUOMACgkQoUhjsh59BL5teACfQuLfIIXop524bwIJ2XUyjAuK
8kMAoKlEtN8uv1qnV4TsHWEs9eEoVd2P
=MQ4R
-END PGP SIGNATURE-


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41750



[Bug c/41750] gcc 4.5.0 miscompiles binutils

2009-10-19 Thread rainer at emrich-ebersheim dot de


--- Comment #3 from rainer at emrich-ebersheim dot de  2009-10-19 11:51 
---
Forgot to mention that's with binutils 2.20 and binutils head.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41750



[Bug c/41750] gcc 4.5.0 miscompiles binutils

2009-10-19 Thread jakub at gcc dot gnu dot org


--- Comment #4 from jakub at gcc dot gnu dot org  2009-10-19 12:06 ---
For a suspected wrong-code bug, the standard way to create a testcase is to
first find out if there are gcc options with which you get the expected result
(such as it works when compiled with -O0, doesn't when compiled with -O2), or,
if even at -O0 new gcc misbehaves some other compiler version.
Then either guess or do a binary search between objects compiled with a known
good and known bad options to narrow it down to a particular source file.
Then try -fno-inline on that file to see if it is still bad, if it is, it will
be far easier, as no inlining is performed and thus fn boundaries are clearer.
In any case either guess the miscompiled function or play with attribute
optimize (known to have issues though) or splitting source file into several
smaller ones to do a binary search to a particular function.
Last, find out what arguments it has been called with and try to emulate that
inside of a main, just preparing the right arguments (and what they point to
etc.), then calling only the problematic function.  And, stub all (noninlined)
functions the problematic function calls, with something that gives back the
right result, use noinline attribute on it and possibly asm volatile
(:::memory); to prevent it being optimized.  Remove any unnecessary stuff,
provide it as preprocessed source, which can be run and show clearly a bad vs.
good behavior (say exit 0 in the right case, abort otherwise).


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41750