From patchwork Fri Feb 9 09:50:40 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric Botcazou X-Patchwork-Id: 871292 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-472930-incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="trPYEHNq"; 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 3zd9L84J90z9s1h for ; Fri, 9 Feb 2018 20:50:55 +1100 (AEDT) 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=ca+ZP6M4ojOwHBS8 W0+BjwNU01Y8ad144/qwPEynzr5mg+8OxJUlhUR1Gc8VObvGzVyicm4no9n8hrow 8Lms4IWP3C8tM1gjpZAjx6H9LuCxVwLR7A+XAK1TqihfI4w46eqbaRKTDVOix4Iq F6gzAoCtII80u83omLhPxOZ8/yw= 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=QiKhuOtrEqVBG7trTZOObb DBDkE=; b=trPYEHNql32Tw+zxf2vOK7WYAWq7DGrBEI6Y5F3bndaAJjhWw7FYRB 9mLPKs+CX+uqxzbovdCn88Gu13WLtskMdQz+yj/58/xyeTnlh0bpHg2hXueQNtwc wRd+E2TZ4MbFSUMvgG0r6kbXbRk7Lu8Rethk54/IyaNsZHho02gek= Received: (qmail 30193 invoked by alias); 9 Feb 2018 09:50:47 -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 28751 invoked by uid 89); 9 Feb 2018 09:50:45 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-11.0 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=ham version=3.3.2 spammy=Hx-languages-length:2176 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; Fri, 09 Feb 2018 09:50:44 +0000 Received: from localhost (localhost [127.0.0.1]) by filtered-smtp.eu.adacore.com (Postfix) with ESMTP id 6214081387 for ; Fri, 9 Feb 2018 10:50:42 +0100 (CET) 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 KxGdkaJD7dMQ for ; Fri, 9 Feb 2018 10:50:42 +0100 (CET) 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 405858137C for ; Fri, 9 Feb 2018 10:50:42 +0100 (CET) From: Eric Botcazou To: gcc-patches@gcc.gnu.org Subject: Fix ICE with scalar_storage_order attribute at -O Date: Fri, 09 Feb 2018 10:50:40 +0100 Message-ID: <1832183.4RgaH2jVQo@polaris> MIME-Version: 1.0 This is a regression present on the mainline in the form of an assertion failure in optimize_bitfield_assignment_op with a scalar_storage_order attribute specifying the reverse endianness wrt the native endianness. I put this assertion because I failed to cover the path at the time but things have changed since then and the attached testcase triggers it now (and also checks that the generated code is correct in this case). Tested on x86_64-suse-linux, applied on the mainline. 2018-02-09 Eric Botcazou * expr.c (optimize_bitfield_assignment_op): Remove obsolete assertion. 2018-02-09 Eric Botcazou * gnat.dg/sso8.adb: New test. * gnat.dg/sso8_pkg.ads: New helper. Index: expr.c =================================================================== --- expr.c (revision 257404) +++ expr.c (working copy) @@ -4726,8 +4726,6 @@ optimize_bitfield_assignment_op (poly_ui } else if (!REG_P (str_rtx) && GET_CODE (str_rtx) != SUBREG) return false; - else - gcc_assert (!reverse); /* If the bit field covers the whole REG/MEM, store_field will likely generate better code. */