Skip to content

Commit

Permalink
8274860: gcc 10.2.1 produces an uninitialized warning in sharedRuntim…
Browse files Browse the repository at this point in the history
…eTrig.cpp

Reviewed-by: phh
  • Loading branch information
caojoshua authored and Paul Hohensee committed Nov 19, 2021
1 parent 9b94409 commit 5e08548
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/hotspot/share/runtime/sharedRuntimeTrig.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,12 @@ static int __kernel_rem_pio2(double *x, double *y, int e0, int nx, int prec, con
fw = 0.0;
for (i=jz;i>=0;i--) fw += fq[i];
y[0] = (ih==0)? fw: -fw;

PRAGMA_DIAG_PUSH
PRAGMA_MAYBE_UNINITIALIZED_IGNORED
fw = fq[0]-fw;
PRAGMA_DIAG_POP

for (i=1;i<=jz;i++) fw += fq[i];
y[1] = (ih==0)? fw: -fw;
break;
Expand Down
5 changes: 5 additions & 0 deletions src/hotspot/share/utilities/compilerWarnings.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@
// https://gcc.gnu.org/gcc-8/changes.html
#if !defined(__clang_major__) && (__GNUC__ >= 8)
#define PRAGMA_STRINGOP_TRUNCATION_IGNORED PRAGMA_DISABLE_GCC_WARNING("-Wstringop-truncation")
#define PRAGMA_MAYBE_UNINITIALIZED_IGNORED PRAGMA_DISABLE_GCC_WARNING("-Wmaybe-uninitialized")
#endif

#if defined(__clang_major__) && \
Expand Down Expand Up @@ -84,6 +85,10 @@
#define PRAGMA_STRINGOP_TRUNCATION_IGNORED
#endif

#ifndef PRAGMA_MAYBE_UNINITIALIZED_IGNORED
#define PRAGMA_MAYBE_UNINITIALIZED_IGNORED
#endif

#ifndef PRAGMA_FORMAT_NONLITERAL_IGNORED
#define PRAGMA_FORMAT_NONLITERAL_IGNORED
#endif
Expand Down

1 comment on commit 5e08548

@openjdk-notifier
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.