summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>2017-01-06 18:41:23 +0000
committerjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>2017-01-06 18:41:23 +0000
commit4004d223e672d4f04a8852016989072931d8800f (patch)
treeebd5bb77a7e172ea127be4131f30b16e786f21f5
parent50079afd1df931161aeed3101f035be3f2162fa7 (diff)
downloadgcc-4004d223e672d4f04a8852016989072931d8800f.tar.gz
* system.h (GCC_DIAGNOSTIC_PUSH_IGNORED, GCC_DIAGNOSTIC_POP,
GCC_DIAGNOSTIC_STRINGIFY): Define. * simplify.c (simplify_transformation_to_array): Use GCC_DIAGNOSTIC_PUSH_IGNORED and GCC_DIAGNOSTIC_POP instead of #pragma GCC diagnostic {push,ignored,pop}. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@244179 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--gcc/ChangeLog3
-rw-r--r--gcc/fortran/ChangeLog6
-rw-r--r--gcc/fortran/simplify.c5
-rw-r--r--gcc/system.h12
4 files changed, 23 insertions, 3 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 236d40dd36a..9600c4371ea 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,5 +1,8 @@
2017-01-06 Jakub Jelinek <jakub@redhat.com>
+ * system.h (GCC_DIAGNOSTIC_PUSH_IGNORED, GCC_DIAGNOSTIC_POP,
+ GCC_DIAGNOSTIC_STRINGIFY): Define.
+
* read-rtl.c (rtx_reader::read_rtx_code): Avoid -Wsign-compare
warning.
diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog
index d1892de8bb1..30646921237 100644
--- a/gcc/fortran/ChangeLog
+++ b/gcc/fortran/ChangeLog
@@ -1,3 +1,9 @@
+2017-01-06 Jakub Jelinek <jakub@redhat.com>
+
+ * simplify.c (simplify_transformation_to_array): Use
+ GCC_DIAGNOSTIC_PUSH_IGNORED and GCC_DIAGNOSTIC_POP instead of
+ #pragma GCC diagnostic {push,ignored,pop}.
+
2017-01-06 Alexandre Oliva <aoliva@redhat.com>
* simplify.c (simplify_transformation_to_array): Silence
diff --git a/gcc/fortran/simplify.c b/gcc/fortran/simplify.c
index c5e7b671691..942b4015447 100644
--- a/gcc/fortran/simplify.c
+++ b/gcc/fortran/simplify.c
@@ -610,18 +610,17 @@ simplify_transformation_to_array (gfc_expr *result, gfc_expr *array, gfc_expr *d
n++;
if (n < result->rank)
{
-#pragma GCC diagnostic push
/* If the nested loop is unrolled GFC_MAX_DIMENSIONS
times, we'd warn for the last iteration, because the
array index will have already been incremented to the
array sizes, and we can't tell that this must make
the test against result->rank false, because ranks
must not exceed GFC_MAX_DIMENSIONS. */
-#pragma GCC diagnostic ignored "-Warray-bounds"
+ GCC_DIAGNOSTIC_PUSH_IGNORED (-Warray-bounds)
count[n]++;
base += sstride[n];
dest += dstride[n];
-#pragma GCC diagnostic pop
+ GCC_DIAGNOSTIC_POP
}
else
done = true;
diff --git a/gcc/system.h b/gcc/system.h
index c6fb0e2dbde..0cd58dba110 100644
--- a/gcc/system.h
+++ b/gcc/system.h
@@ -1140,6 +1140,18 @@ helper_const_non_const_cast (const char *p)
#define VALGRIND_FREELIKE_BLOCK(x,y)
#endif
+/* Macros to temporarily ignore some warnings. */
+#if GCC_VERSION >= 6000
+#define GCC_DIAGNOSTIC_STRINGIFY(x) #x
+#define GCC_DIAGNOSTIC_PUSH_IGNORED(x) \
+ _Pragma ("GCC diagnostic push") \
+ _Pragma (GCC_DIAGNOSTIC_STRINGIFY (GCC diagnostic ignored #x))
+#define GCC_DIAGNOSTIC_POP _Pragma ("GCC diagnostic pop")
+#else
+#define GCC_DIAGNOSTIC_PUSH_IGNORED(x)
+#define GCC_DIAGNOSTIC_POP
+#endif
+
/* In LTO -fwhole-program build we still want to keep the debug functions available
for debugger. Mark them as used to prevent removal. */
#if (GCC_VERSION > 4000)