]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
Fix ICE in kernels-decompose-pr100280-1.c testcase
authorKwok Cheung Yeung <kcy@codesourcery.com>
Tue, 10 May 2022 14:46:37 +0000 (15:46 +0100)
committerKwok Cheung Yeung <kcy@codesourcery.com>
Tue, 28 Jun 2022 20:55:30 +0000 (13:55 -0700)
Check that there is a DECL_INITIAL associated with prev_stmt before using it.

2022-04-15  Kwok Cheung Yeung  <kcy@codesourcery.com>

gcc/c-family/
* c-omp.cc (check_and_annotate_for_loop): Check that the DECL_INITIAL
is non-NULL before using.

gcc/c-family/ChangeLog.omp
gcc/c-family/c-omp.cc

index 84e73af682467187a491eff29154b42ab7988d2f..e46a556ada5cdf38b7224c1aacc9b83c449315e4 100644 (file)
@@ -1,3 +1,9 @@
+2022-04-15  Kwok Cheung Yeung  <kcy@codesourcery.com>
+
+       gcc/c-family/
+       * c-omp.cc (check_and_annotate_for_loop): Check that the DECL_INITIAL
+       is non-NULL before using.
+
 2022-05-12  Jakub Jelinek  <jakub@redhat.com>
 
        Backport from mainline:
index ddcd52f06e7d7697364c1a2da5b5f276259bfb2c..a6fea51d46e050cb10c3d001e5dbf9b2bdd56108 100644 (file)
@@ -3400,6 +3400,7 @@ check_and_annotate_for_loop (tree *nodeptr, tree_stmt_iterator *prev_tsi,
          unlink_prev = true;
        }
       else if (is_local_var (prev_stmt)
+              && DECL_INITIAL (prev_stmt)
               && !TREE_SIDE_EFFECTS (DECL_INITIAL (prev_stmt)))
        {
          /* If the preceding statement is the declaration of the loop