From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 29485 invoked by alias); 6 Oct 2011 14:08:29 -0000 Received: (qmail 29474 invoked by uid 22791); 6 Oct 2011 14:08:28 -0000 X-SWARE-Spam-Status: No, hits=-2.9 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from localhost (HELO gcc.gnu.org) (127.0.0.1) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 06 Oct 2011 14:08:10 +0000 From: "rguenth at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug middle-end/50628] [4.7 Regression] gfortran.fortran-torture/execute/entry_4.f fails Date: Thu, 06 Oct 2011 14:08:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: middle-end X-Bugzilla-Keywords: wrong-code X-Bugzilla-Severity: normal X-Bugzilla-Who: rguenth at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: 4.7.0 X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated Content-Type: text/plain; charset="UTF-8" MIME-Version: 1.0 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2011-10/txt/msg00331.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50628 --- Comment #5 from Richard Guenther 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.