From: Jerry D <jvdelisle2@gmail.com>
To: Tobias Burnus <tobias@codesourcery.com>,
Harald Anlauf <anlauf@gmx.de>, gfortran <fortran@gcc.gnu.org>
Cc: gcc-patches <gcc-patches@gcc.gnu.org>
Subject: Re: [patch, libgfortran] Initailize some variable to get rid of nuisance warnings.
Date: Mon, 27 Feb 2023 18:16:03 -0800 [thread overview]
Message-ID: <4f59e4c6-9bb9-daf8-6ed1-cc9235b54144@gmail.com> (raw)
In-Reply-To: <4304f8e3-c755-2c3a-89ee-94882ca01293@codesourcery.com>
Pushed, thanks for feedback
On 2/26/23 11:54 PM, Tobias Burnus wrote:
> Just side remarks, the 0 init in the patch is fine.
>
> On 27.02.23 03:53, Jerry D via Gcc-patches wrote:
>
>>> regarding PACK: since this is a bogus warning as the compiler does
>>> not realize that dim >= 1, wouldn't a
>>>
>>> gcc_assert (dim >= 1);
>
> Note: gcc_assert only exists in the compiler itself; in libgfortran, we
> use GFC_ASSERT or directly 'assert'.
>
> You could also use 'if (dim < 1) __builtin_unreachable();' – or since
> GCC 13:
>
> __attribute__((assume (dim >= 1)));
>
> Tobias
>
> PS: In Fortran, '-fopenmp-simd' plus '!$omp assume holds(dim>=0) ...
> !$omp end assume' (or !$omp ... + block/end block) can be used to denote
> such assumptions. '-fopenmp-simd' enables only those bits of OpenMP that
> do not require any library support (no libgomp, no pthreads), contrary
> to '-fopenmp'.
>
> -----------------
> Siemens Electronic Design Automation GmbH; Anschrift: Arnulfstraße 201,
> 80634 München; Gesellschaft mit beschränkter Haftung; Geschäftsführer:
> Thomas Heurung, Frank Thürauf; Sitz der Gesellschaft: München;
> Registergericht München, HRB 106955
prev parent reply other threads:[~2023-02-28 2:16 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-02-26 19:52 Jerry D
2023-02-26 20:59 ` Harald Anlauf
2023-02-27 2:53 ` Jerry D
2023-02-27 6:30 ` Thomas Koenig
2023-02-27 7:54 ` Tobias Burnus
2023-02-28 2:16 ` Jerry D [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4f59e4c6-9bb9-daf8-6ed1-cc9235b54144@gmail.com \
--to=jvdelisle2@gmail.com \
--cc=anlauf@gmx.de \
--cc=fortran@gcc.gnu.org \
--cc=gcc-patches@gcc.gnu.org \
--cc=tobias@codesourcery.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).