From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 118426 invoked by alias); 6 Oct 2017 11:50:10 -0000 Mailing-List: contact fortran-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Post: List-Help: , Sender: fortran-owner@gcc.gnu.org Received: (qmail 117080 invoked by uid 89); 6 Oct 2017 11:50:09 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.6 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,RCVD_IN_SORBS_SPAM,SPF_PASS autolearn=no version=3.3.2 spammy=H*RU:74.125.82.65, Hx-spam-relays-external:74.125.82.65, sessions, sgktroutmaskaplwashingtonedu X-HELO: mail-wm0-f65.google.com Received: from mail-wm0-f65.google.com (HELO mail-wm0-f65.google.com) (74.125.82.65) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 06 Oct 2017 11:50:06 +0000 Received: by mail-wm0-f65.google.com with SMTP id l10so8628134wmg.1 for ; Fri, 06 Oct 2017 04:50:06 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=44ZC6InpmCvz3FeJ7bh6FackprrmP7o0iqMo+5WN6qo=; b=sN8gmwdJ2wI2RFmimwMXKbGZye/cld2Iz5WWQ2P+JYBqx9Lj5TWc5t0zRdf/tTelut 8qYltU7xRFNx0+vKDxF3h8R0Qak4a0uteRzveBiAaOlJN7t3AujtlpEQ2gfEHL6TX+Po 4HibhWSEShZv9jfYsyHV3z/fz9J96ayknrhDr4uMRYKq9mfB+QFCQ2N4k1a1EYxYUjzj lFFnDyjz3BQfoLYf4P3vnd0PwYSi2fg69w/GUeGIHsb/xbnoA/0cPu0NEqHhw5cxASOS eDSCyephY8WWP9BNV9GUvxOqeM11feZuLhLvVwp7ajip/ySgAo+x+97AQp3wSHM2Gj3/ vfcQ== X-Gm-Message-State: AMCzsaVHTPNHBGmgcuNY/Sn5UOSM8Pzpp8AyjFR+Z6GlkwGnGZ+f0o0Y M3XX4+lZnTmlyQvHPe3z0OGc6wj7uExqvaS3H0w= X-Google-Smtp-Source: AOwi7QBoS6enZHRe7Dnqqct5HUHIhENDQ7MQJCsCcXtMEx6dPZaY+sPa+bkDxeToL9JvOGRZOwVRAcDNb1h+g/VJkV8= X-Received: by 10.80.168.70 with SMTP id j64mr2979624edc.182.1507290604484; Fri, 06 Oct 2017 04:50:04 -0700 (PDT) MIME-Version: 1.0 Received: by 10.80.143.34 with HTTP; Fri, 6 Oct 2017 04:50:04 -0700 (PDT) In-Reply-To: <20171006062034.GA33771@troutmask.apl.washington.edu> References: <20171005211023.GA67765@troutmask.apl.washington.edu> <20171006050210.GB33258@troutmask.apl.washington.edu> <1CFEB0A1-3A0C-4639-B97E-0761EA007933@gmail.com> <20171006062034.GA33771@troutmask.apl.washington.edu> From: Richard Biener Date: Fri, 06 Oct 2017 11:50:00 -0000 Message-ID: Subject: Re: BOZ, F2008 and F2015, and future of gfortran To: Steve Kargl Cc: Jerry DeLisle , "fortran@gcc.gnu.org" Content-Type: text/plain; charset="UTF-8" X-IsSubscribed: yes X-SW-Source: 2017-10/txt/msg00027.txt.bz2 On Fri, Oct 6, 2017 at 8:20 AM, Steve Kargl wrote: > On Fri, Oct 06, 2017 at 07:58:58AM +0200, Richard Biener wrote: >> On October 6, 2017 7:02:10 AM GMT+02:00, Steve Kargl wrote: >> > >> >program foo >> > integer :: i(2) = [z'124', z'bed'] >> > print *, i >> >end program foo >> > >> >First, this is nonstandard in that a BOZ-literal-constant cannot >> >appear in the above context. Unfortunately, the above leads >> >to an ICE. I need to figure how to walk the array constructor >> >and have gfortran use the type and type kind parameter of the >> >lhs to convert the rhs boz. >> >> I'm just guessing the semantics but you might find native_encode/interpret_expr useful in this context. >> > > I can handle the needed transformation in the Fortran FE > once I figure out how we handle array constructors. In > Fortran, [z'124', z'bed'] is an array constructor and > Fortran forbids a BOZ from appearing here. This is > currently allowed in gfortran, because gfortran upon > parsing a BOZ immediately converts it to an INTEGER(N) > (with N=8 or 16 depending on target). My patch > gives a BOZ a basic type of BT_BOZ, which is new and > treated as a typeless sequence of bits. I need to catch > an entity with a BT_BOZ basic type and do essentially a > JIT conversion to the correct type when translating an > array constructor. Yes, and depending on how you represent BT_BOZ native_interpret_expr is exactly such JIT (interpreting a memory region in target representation as a tree object with given type). native_encode_expr does the reverse transform (create such memory region from a constant tree object). > Unfortunately, gdb sessions suggest > that we have a use-after-free bug lurking. > > -- > Steve > 20170425 https://www.youtube.com/watch?v=VWUpyCsUKR4 > 20161221 https://www.youtube.com/watch?v=IbCHE-hONow