From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 1671 invoked by alias); 12 Dec 2014 16:10:23 -0000 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 Received: (qmail 1594 invoked by uid 48); 12 Dec 2014 16:10:19 -0000 From: "jakub at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug sanitizer/64289] New: ICE with -fsanitize=float-cast-overflow Date: Fri, 12 Dec 2014 16:10:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: sanitizer X-Bugzilla-Version: 5.0 X-Bugzilla-Keywords: ice-on-valid-code X-Bugzilla-Severity: normal X-Bugzilla-Who: jakub at gcc dot gnu.org X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: jakub at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status keywords bug_severity priority component assigned_to reporter cc Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-SW-Source: 2014-12/txt/msg01444.txt.bz2 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64289 Bug ID: 64289 Summary: ICE with -fsanitize=float-cast-overflow Product: gcc Version: 5.0 Status: UNCONFIRMED Keywords: ice-on-valid-code Severity: normal Priority: P3 Component: sanitizer Assignee: jakub at gcc dot gnu.org Reporter: jakub at gcc dot gnu.org CC: dodji at gcc dot gnu.org, dvyukov at gcc dot gnu.org, jakub at gcc dot gnu.org, kcc at gcc dot gnu.org, mpolacek at gcc dot gnu.org /* { dg-do compile } */ /* { dg-options "-fsanitize=float-cast-overflow" } */ int foo (int a) { return (int) (0 ? 0 : a ? a : 0.5); } ICEs when compiled as C, because save_expr must not be used until c_fully_fold. Unfortunately as convert.c is shared by all FEs, it can't call c_save_expr instead. So, either we'd need to turn it into a langhook, or we need a workaround in c-convert.c like we've done already for the other save_expr in convert.c case.