diff options
author | jakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4> | 2008-12-01 15:10:25 +0000 |
---|---|---|
committer | jakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4> | 2008-12-01 15:10:25 +0000 |
commit | 5846b949460ea036e548e9a9fd72ae4c10993ce9 (patch) | |
tree | d549d9aed6ba1fe9b773286c6c92016841748612 /gcc/c-omp.c | |
parent | e52dd25836ec08885b8206b330060617281db851 (diff) | |
download | gcc-5846b949460ea036e548e9a9fd72ae4c10993ce9.tar.gz |
PR c++/38348
* c-omp.c (c_finish_omp_for): Only transform pointer
++ or -- into MODIFY_EXPR if second argument is non-NULL.
* g++.dg/gomp/for-19.C: New test.
* testsuite/libgomp.c++/for-6.C: New test.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@142318 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/c-omp.c')
-rw-r--r-- | gcc/c-omp.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/gcc/c-omp.c b/gcc/c-omp.c index b06c83039b9..3be3729a32c 100644 --- a/gcc/c-omp.c +++ b/gcc/c-omp.c @@ -357,7 +357,8 @@ c_finish_omp_for (location_t locus, tree declv, tree initv, tree condv, break; incr_ok = true; - if (POINTER_TYPE_P (TREE_TYPE (decl))) + if (POINTER_TYPE_P (TREE_TYPE (decl)) + && TREE_OPERAND (incr, 1)) { tree t = fold_convert (sizetype, TREE_OPERAND (incr, 1)); |