From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 19773 invoked by alias); 6 Jan 2013 13:24:31 -0000 Received: (qmail 19545 invoked by uid 48); 6 Jan 2013 13:23:57 -0000 From: "ubizjak at gmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug rtl-optimization/55845] [4.8 Regression] 454.calculix miscompares with -march=btver2 -O3 -ffastmath -fschedule-insns -mvzeroupper for test data run Date: Sun, 06 Jan 2013 13:24:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: rtl-optimization X-Bugzilla-Keywords: wrong-code X-Bugzilla-Severity: normal X-Bugzilla-Who: ubizjak at gmail dot com X-Bugzilla-Status: NEW X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: 4.8.0 X-Bugzilla-Changed-Fields: CC 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: 2013-01/txt/msg00404.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55845 Uros Bizjak changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |bonzini at gnu dot org --- Comment #9 from Uros Bizjak 2013-01-06 13:23:54 UTC --- It is try_head_merge_bb that moves unspec_volatile to the wrong place. However, the core of the problem lies in can_move_insns_accross, which does not special-case unspec_volatiles. The untested df-problems.c patch that fixes the failing testcase: --cut here-- Index: df-problems.c =================================================================== --- df-problems.c (revision 194945) +++ df-problems.c (working copy) @@ -3916,6 +3916,10 @@ can_move_insns_across (rtx from, rtx to, rtx acros break; if (NONDEBUG_INSN_P (insn)) { + /* Do not move unspec_volatile insns. */ + if (GET_CODE (PATTERN (insn)) == UNSPEC_VOLATILE) + break; + if (may_trap_or_fault_p (PATTERN (insn)) && (trapping_insns_in_across || other_branch_live != NULL)) break; --cut here-- Adding Paolo B. to CC.