public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH][committed][c++ frontend]: initialize ivdep value
@ 2024-01-10 13:48 Tamar Christina
  0 siblings, 0 replies; only message in thread
From: Tamar Christina @ 2024-01-10 13:48 UTC (permalink / raw)
  To: gcc-patches; +Cc: nd, jason, nathan

[-- Attachment #1: Type: text/plain, Size: 876 bytes --]

Hi All,

Should control enter the switch from one of the cases other than
the IVDEP one then the variable remains uninitialized.

This fixes it by initializing it to false.

Bootstrapped Regtested on aarch64-none-linux-gnu, x86_64-pc-linux-gnu
and no issues

Committed as obvious.

Thanks,
Tamar

gcc/cp/ChangeLog:

	* parser.cc (cp_parser_pragma): Initialize to false.

--- inline copy of patch -- 
diff --git a/gcc/cp/parser.cc b/gcc/cp/parser.cc
index 379aeb56b152b9b29606ba4d75ad4c49dfe92aac..1b4ce1497e893d6463350eecf5ef4e88957f5f00 100644
--- a/gcc/cp/parser.cc
+++ b/gcc/cp/parser.cc
@@ -50625,7 +50625,7 @@ cp_parser_pragma (cp_parser *parser, enum pragma_context context, bool *if_p)
     case PRAGMA_UNROLL:
     case PRAGMA_NOVECTOR:
       {
-	bool ivdep;
+	bool ivdep = false;
 	tree unroll = NULL_TREE;
 	bool novector = false;
 	const char *pragma_str;




-- 

[-- Attachment #2: rb18142.patch --]
[-- Type: text/plain, Size: 471 bytes --]

diff --git a/gcc/cp/parser.cc b/gcc/cp/parser.cc
index 379aeb56b152b9b29606ba4d75ad4c49dfe92aac..1b4ce1497e893d6463350eecf5ef4e88957f5f00 100644
--- a/gcc/cp/parser.cc
+++ b/gcc/cp/parser.cc
@@ -50625,7 +50625,7 @@ cp_parser_pragma (cp_parser *parser, enum pragma_context context, bool *if_p)
     case PRAGMA_UNROLL:
     case PRAGMA_NOVECTOR:
       {
-	bool ivdep;
+	bool ivdep = false;
 	tree unroll = NULL_TREE;
 	bool novector = false;
 	const char *pragma_str;




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

only message in thread, other threads:[~2024-01-10 13:48 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-01-10 13:48 [PATCH][committed][c++ frontend]: initialize ivdep value Tamar Christina

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