diff options
author | Balaji V. Iyer <balaji.v.iyer@intel.com> | 2013-01-22 23:57:40 +0000 |
---|---|---|
committer | Balaji V. Iyer <balaji.v.iyer@intel.com> | 2013-01-22 23:57:40 +0000 |
commit | 7bc59fd811e3e658fd3bebf3fe8c14ea2af6f54e (patch) | |
tree | 2d9dccfeeed624a43d6b21096dc807ed64ef94da | |
parent | 42bdac723fc2d5ad4251adf078d16b42855c3b8c (diff) |
fixed an infinite loop error in Cilk pragma grainsize.
+2013-01-22 Balaji V. Iyer <balaji.v.iyer@intel.com>
+
+ * gcc.dg/cilk-plus/cilk_keywords_test/errors/grainsize_error1.c: New
+ test.
+
+2013-01-22 Balaji V. Iyer <balaji.v.iyer@intel.com>
+
+ * c/c-parser.c (c_parser_cilk_grainsize): Added a function call to skip
+ to the end of pragma whenever an error occurred.
+
git-svn-id: https://gcc.gnu.org/svn/gcc/branches/cilkplus@195392 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r-- | gcc/ChangeLog.cilkplus | 5 | ||||
-rw-r--r-- | gcc/c/c-parser.c | 4 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog.cilkplus | 5 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/cilk-plus/cilk_keywords_test/errors/grainsize_error1.c | 8 |
4 files changed, 22 insertions, 0 deletions
diff --git a/gcc/ChangeLog.cilkplus b/gcc/ChangeLog.cilkplus index 8cef67e8353..7fec9ce085f 100644 --- a/gcc/ChangeLog.cilkplus +++ b/gcc/ChangeLog.cilkplus @@ -1,3 +1,8 @@ +2013-01-22 Balaji V. Iyer <balaji.v.iyer@intel.com> + + * c/c-parser.c (c_parser_cilk_grainsize): Added a function call to skip + to the end of pragma whenever an error occurred. + 2013-01-09 Balaji V. Iyer <balaji.v.iyer@intel.com> * gimplify.c (gimplify_expr): Added a check to see if error has occured. diff --git a/gcc/c/c-parser.c b/gcc/c/c-parser.c index 0274e0d9d3f..26c3c52d3a2 100644 --- a/gcc/c/c-parser.c +++ b/gcc/c/c-parser.c @@ -9340,7 +9340,11 @@ c_parser_cilk_grainsize (c_parser *parser) warning (0, "%<#pragma cilk grainsize is not followed by cilk_for"); return; } + else + c_parser_skip_to_pragma_eol (parser); } + else + c_parser_skip_to_pragma_eol (parser); return; } diff --git a/gcc/testsuite/ChangeLog.cilkplus b/gcc/testsuite/ChangeLog.cilkplus index 2dc93565979..47b85ba2951 100644 --- a/gcc/testsuite/ChangeLog.cilkplus +++ b/gcc/testsuite/ChangeLog.cilkplus @@ -1,3 +1,8 @@ +2013-01-22 Balaji V. Iyer <balaji.v.iyer@intel.com> + + * gcc.dg/cilk-plus/cilk_keywords_test/errors/grainsize_error1.c: New + test. + 2013-01-09 Balaji V. Iyer <balaji.v.iyer@intel.com> * g++.dg/cilk-plus/cilk_keywords_test/execute/c++11-tests/lambda_spawns.cc: New test. diff --git a/gcc/testsuite/gcc.dg/cilk-plus/cilk_keywords_test/errors/grainsize_error1.c b/gcc/testsuite/gcc.dg/cilk-plus/cilk_keywords_test/errors/grainsize_error1.c new file mode 100644 index 00000000000..c1b821dd7c0 --- /dev/null +++ b/gcc/testsuite/gcc.dg/cilk-plus/cilk_keywords_test/errors/grainsize_error1.c @@ -0,0 +1,8 @@ +void check() { + int i, a[256]; +#pragma cilk grainsize=cilk /* { dg-error "undeclared" } */ + _Cilk_for(i = 0; i < 256; i++) { + a[i] = i; + } +} + |