public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc/devel/omp/gcc-12] Fix ICE in kernels-decompose-pr100280-1.c testcase
@ 2022-06-29 14:48 Kwok Yeung
  0 siblings, 0 replies; only message in thread
From: Kwok Yeung @ 2022-06-29 14:48 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:2f7ab1a1fdedb4529c964f462cb6b108caf137ae

commit 2f7ab1a1fdedb4529c964f462cb6b108caf137ae
Author: Kwok Cheung Yeung <kcy@codesourcery.com>
Date:   Tue May 10 15:46:37 2022 +0100

    Fix ICE in kernels-decompose-pr100280-1.c testcase
    
    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.

Diff:
---
 gcc/c-family/ChangeLog.omp | 6 ++++++
 gcc/c-family/c-omp.cc      | 1 +
 2 files changed, 7 insertions(+)

diff --git a/gcc/c-family/ChangeLog.omp b/gcc/c-family/ChangeLog.omp
index 84e73af6824..e46a556ada5 100644
--- a/gcc/c-family/ChangeLog.omp
+++ b/gcc/c-family/ChangeLog.omp
@@ -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:
diff --git a/gcc/c-family/c-omp.cc b/gcc/c-family/c-omp.cc
index ddcd52f06e7..a6fea51d46e 100644
--- a/gcc/c-family/c-omp.cc
+++ b/gcc/c-family/c-omp.cc
@@ -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


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2022-06-29 14:48 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-06-29 14:48 [gcc/devel/omp/gcc-12] Fix ICE in kernels-decompose-pr100280-1.c testcase Kwok Yeung

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).