From patchwork Thu Jun 26 09:43:23 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Uros Bizjak X-Patchwork-Id: 364320 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id CF0851400B5 for ; Thu, 26 Jun 2014 19:43:35 +1000 (EST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :mime-version:date:message-id:subject:from:to:cc:content-type; q=dns; s=default; b=J9qtQPzExK3XxitGRRg93H5g5HBfYbFDhy7H7MKbeNf Ga0RwlLId5GMArfWDULthQ0dqHwAa8BYV05+ElV6x//bGukG60ZGleHANNjh7yO0 WbED8m8j3AJRtxvZzmuJ15VqZ4PMsxH9z66ps1koHb1VoFg/2o8WEV95NaNvbS18 = DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :mime-version:date:message-id:subject:from:to:cc:content-type; s=default; bh=mWC8nif43dkj5lmUi7LFY2RLaDo=; b=vP8KhEs2jOyZIqRzg jj7glbMHZ7LFRRFEWCLl0Q3VRDQiFvyysXv3BjMSki1DhiRdFp54TE0NBX87HwP4 dYTvrjykcdLu5xKEk1nYMg0+PZXzEfbCLKhRdhnswLHYD+qn0BvK2dlXGm6JT+HV sFfpyUkmFI00FN++QN5iWiM4d0= Received: (qmail 21298 invoked by alias); 26 Jun 2014 09:43:29 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 21286 invoked by uid 89); 26 Jun 2014 09:43:28 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.4 required=5.0 tests=AWL, BAYES_00, FREEMAIL_FROM, RCVD_IN_DNSWL_LOW, SPF_PASS autolearn=ham version=3.3.2 X-HELO: mail-lb0-f178.google.com Received: from mail-lb0-f178.google.com (HELO mail-lb0-f178.google.com) (209.85.217.178) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-SHA encrypted) ESMTPS; Thu, 26 Jun 2014 09:43:27 +0000 Received: by mail-lb0-f178.google.com with SMTP id 10so2708559lbg.23 for ; Thu, 26 Jun 2014 02:43:24 -0700 (PDT) MIME-Version: 1.0 X-Received: by 10.112.162.70 with SMTP id xy6mr9899408lbb.40.1403775804039; Thu, 26 Jun 2014 02:43:24 -0700 (PDT) Received: by 10.152.104.140 with HTTP; Thu, 26 Jun 2014 02:43:23 -0700 (PDT) Date: Thu, 26 Jun 2014 11:43:23 +0200 Message-ID: Subject: [PATCH, alpha]: FIX PR61586, ICE in alpha_handle_trap_shadows From: Uros Bizjak To: "gcc-patches@gcc.gnu.org" Cc: Richard Henderson Hello! Attached patch handles (barrier) RTXes that can be reached when __builtin_trap builtin is used. 2014-06-26 Uros Bizjak PR target/61586 * config/alpha/alpha.c (alpha_handle_trap_shadows): Handle BARRIER RTX. testsuite/ChangeLog: 2014-06-26 Uros Bizjak PR target/61586 * gcc.target/alpha/pr61586.c: New test. Bootstrapped and regression tested on alphaev68-linux-gnu. OK for mainline and 4.9 ? Uros. Index: config/alpha/alpha.c =================================================================== --- config/alpha/alpha.c (revision 211941) +++ config/alpha/alpha.c (working copy) @@ -8717,6 +8717,11 @@ alpha_handle_trap_shadows (void) } break; + case BARRIER: + /* __builtin_unreachable can expand to no code at all, + leaving (barrier) RTXes in the instruction stream. */ + goto close_shadow_notrapb; + case JUMP_INSN: case CALL_INSN: case CODE_LABEL: @@ -8732,6 +8737,7 @@ alpha_handle_trap_shadows (void) n = emit_insn_before (gen_trapb (), i); PUT_MODE (n, TImode); PUT_MODE (i, TImode); + close_shadow_notrapb: trap_pending = 0; shadow.used.i = 0; shadow.used.fp = 0; Index: testsuite/gcc.target/alpha/pr61586.c =================================================================== --- testsuite/gcc.target/alpha/pr61586.c (revision 0) +++ testsuite/gcc.target/alpha/pr61586.c (working copy) @@ -0,0 +1,10 @@ +/* { dg-do compile } */ +/* { dg-options "-O2 -mieee" } */ + +void foo (int *dimensions, double **params, int hh) +{ + if (params[hh]) + ; + else if (dimensions[hh] > 0) + params[hh][0] = 1.0f; +}