public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "burnus at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug middle-end/106449] ICE in #pragma omp parallel for simd
Date: Tue, 26 Jul 2022 19:46:40 +0000	[thread overview]
Message-ID: <bug-106449-4-N1v7TroXrN@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-106449-4@http.gcc.gnu.org/bugzilla/>

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106449

Tobias Burnus <burnus at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |ice-on-valid-code
     Ever confirmed|0                           |1
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2022-07-26

--- Comment #1 from Tobias Burnus <burnus at gcc dot gnu.org> ---
My impression is that the ICE is due to having
  fold_build2_loc (0, PLUS_EXPR, type, op0, op1)
with
(gdb) p debug_tree(type)
 <pointer_type 0x7ffff6feda80 [...]
(gdb) p debug_tree(op0)
 <integer_cst 0x7ffff7128b70 type <pointer_type 0x7ffff6feda80> constant 256>
(gdb) p debug_tree(op1)
 <var_decl 0x7ffff7148480 p.0
    type <pointer_type 0x7ffff6feda80  [...]

Namely: variable PLUS_EXPR integer_cst  - instead of a POINTER_PLUS_EXPR.


Patch would be something like the following – except that there are several
additional PLUS_EXPR in that function and that fold_build_pointer_plus assumes
that the first argument is the pointer and the second the offset, which is
converted via convert_to_ptrofftype_loc ...

--- a/gcc/omp-expand.cc
+++ b/gcc/omp-expand.cc
@@ -6882 +6882,4 @@ expand_omp_simd (struct omp_region *region, struct
omp_for_data *fd)
-             t = fold_build2 (PLUS_EXPR, TREE_TYPE (t), t, t2);
+             if (POINTER_TYPE_P (TREE_TYPE (t)))
+               t = fold_build_pointer_plus (t, t2);
+             else
+               t = fold_build2 (PLUS_EXPR, TREE_TYPE (t), t, t2);

  reply	other threads:[~2022-07-26 19:46 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-26 16:10 [Bug middle-end/106449] New: " sandra at gcc dot gnu.org
2022-07-26 19:46 ` burnus at gcc dot gnu.org [this message]
2022-07-27  7:10 ` [Bug middle-end/106449] " rguenth at gcc dot gnu.org
2022-07-27  8:35 ` [Bug middle-end/106449] ICE in #pragma omp parallel for simd since r6-4544-ge01d41e553aae245 marxin at gcc dot gnu.org
2022-07-27 11:05 ` jakub at gcc dot gnu.org
2022-07-27 12:19 ` jakub at gcc dot gnu.org
2022-07-27 14:07 ` jakub at gcc dot gnu.org
2022-07-27 14:35 ` burnus at gcc dot gnu.org
2022-07-27 15:26 ` burnus at gcc dot gnu.org
2022-07-28 10:11 ` jakub at gcc dot gnu.org
2022-07-28 10:12 ` jakub at gcc dot gnu.org
2022-07-29  7:54 ` cvs-commit at gcc dot gnu.org
2022-07-29  8:06 ` jakub at gcc dot gnu.org
2022-07-30  9:34 ` cvs-commit at gcc dot gnu.org
2022-07-30 10:09 ` jakub at gcc dot gnu.org
2022-11-03 14:09 ` jakub at gcc dot gnu.org
2022-11-28 22:08 ` pinskia at gcc dot gnu.org

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=bug-106449-4-N1v7TroXrN@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /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).