From patchwork Sat Sep 15 09:21:51 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric Botcazou X-Patchwork-Id: 970200 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=gcc.gnu.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=gcc-patches-return-485704-incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=adacore.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="rP0WZRRd"; dkim-atps=neutral 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 42C6PG6KW1z9sCS for ; Sat, 15 Sep 2018 19:22:56 +1000 (AEST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:subject:date:message-id:mime-version:content-type :content-transfer-encoding; q=dns; s=default; b=FZ0j0E6ewaZf/h1A fDV9c8c24n1I0rNcI4o/7TutwSYgT+1Q5C7PDZC88JFgYlw+0sPRSK4qPJzOCWg7 48KE0rL9AMYnb6rG6ObKfrr4q+R61rRCLyLYp4cd05vUOh2p45kpBADhpyi5VQrH FnvzVezL9NVzqp0Oz9nNyAT7fQk= 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:from :to:subject:date:message-id:mime-version:content-type :content-transfer-encoding; s=default; bh=rilm3j/a6SwkBPDJYcOQKW 6HrPk=; b=rP0WZRRd3B5HO5yZ6/RT/MFubcgQJPf4KeT7EzvCD80cZqcR4m6aH6 20hQl2H3q6t8QIKMzKqmUzryZqbsUlz+59suQzewNgCXkOQ/V8qnZvpDJFVNwTil m5GV60BhnugFaO8703vkQfzr8N25lQBkAr9znZWNs69sWNbzNrmXQ= Received: (qmail 56746 invoked by alias); 15 Sep 2018 09:22:48 -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 56733 invoked by uid 89); 15 Sep 2018 09:22:47 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-10.7 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_2, GIT_PATCH_3, KAM_NUMSUBJECT, RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=ham version=3.3.2 spammy= X-HELO: smtp.eu.adacore.com Received: from mel.act-europe.fr (HELO smtp.eu.adacore.com) (194.98.77.210) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Sat, 15 Sep 2018 09:22:45 +0000 Received: from localhost (localhost [127.0.0.1]) by filtered-smtp.eu.adacore.com (Postfix) with ESMTP id 739EB82272 for ; Sat, 15 Sep 2018 11:22:43 +0200 (CEST) Received: from smtp.eu.adacore.com ([127.0.0.1]) by localhost (smtp.eu.adacore.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id gYpgwE1FO6Cp for ; Sat, 15 Sep 2018 11:22:43 +0200 (CEST) Received: from polaris.localnet (bon31-6-88-161-99-133.fbx.proxad.net [88.161.99.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.eu.adacore.com (Postfix) with ESMTPSA id 4F5E78139C for ; Sat, 15 Sep 2018 11:22:43 +0200 (CEST) From: Eric Botcazou To: gcc-patches@gcc.gnu.org Subject: Fix PR middle-end/86864 Date: Sat, 15 Sep 2018 11:21:51 +0200 Message-ID: <3366550.yXoTkXDyxz@polaris> MIME-Version: 1.0 This is a regression present on the mainline: an assertion is triggered in commit_one_edge_insertion at expansion time because a BB contains a BARRIER in its BB_END, which is not valid. expand_gimple_basic_block is supposed to prevent that from happening, but it doesn't properly handle the sequence: JUMP BARRIER JUMP_TABLE_DATA BARRIER that can be generated for a switch construct. Bootstrapped/regtested on x86_64-suse-linux, applied on mainline as obvious. 2018-09-15 Eric Botcazou PR middle-end/86864 * cfgexpand.c (expand_gimple_basic_block): Be prepared for a BARRIER before and after a JUMP_TABLE_DATA. 2018-09-15 Eric Botcazou * gcc.c-torture/compile/20180915-1.c: New test. Index: cfgexpand.c =================================================================== --- cfgexpand.c (revision 264202) +++ cfgexpand.c (working copy) @@ -5810,6 +5810,8 @@ expand_gimple_basic_block (basic_block b last = PREV_INSN (last); if (JUMP_TABLE_DATA_P (last)) last = PREV_INSN (PREV_INSN (last)); + if (BARRIER_P (last)) + last = PREV_INSN (last); BB_END (bb) = last; update_bb_for_insn (bb);