Hi,
On Mon, Apr 17, 2017 at 09:11:56PM +0800, comp wrote:
> float b;
> *(int*)&b=a;
This is undefined behaviour. Try with -fno-strict-aliasing, does it
then work as you expect?
Segher
comp writes:
> Hi all,
> I recently have a problem with LRA.
> 1 The Bug use case
> int a=10;
> float c=2.0,d;
> main()
> {
> float b;
> *(int*)&b=a;
> d=b+c;
> }
>
> 2 The problem description
> In the pass LRA, curr_insn_transform () deal with the addition statement d =
Snapshot gcc-5-20170418 is now available on
ftp://gcc.gnu.org/pub/gcc/snapshots/5-20170418/
and on various mirrors, see http://gcc.gnu.org/mirrors.html for details.
This snapshot has been generated from the GCC 5 SVN branch
with the following options: svn://gcc.gnu.org/svn/gcc/branches/gcc-5