This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug middle-end/50628] [4.7 Regression] gfortran.fortran-torture/execute/entry_4.f fails
- From: "rguenth at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Thu, 06 Oct 2011 14:08:08 +0000
- Subject: [Bug middle-end/50628] [4.7 Regression] gfortran.fortran-torture/execute/entry_4.f fails
- Auto-submitted: auto-generated
- References: <bug-50628-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50628
--- Comment #5 from Richard Guenther <rguenth at gcc dot gnu.org> 2011-10-06 14:08:08 UTC ---
Basically SRA transforms
union u { char c; bool b; };
u.c = ...;
if (u.c ...)
to
u.c = ...;
bool reg = u.b;
u.b = reg;
if (u.c ...)
which is at least suspicious. If a user would write this I'd say it
is simply undefined (because u.b cannot represent all values that
are in the memory location of u.c).
FRE exposes this via native_interpret_int which at the end does
return double_int_to_tree (type, result);
}
which truncates the value to 1-bit precision. We probably don't want
out-of-precision INTEGER_CSTs here, so we could at most fail here.
But clearly SRA should avoid doing what it does.