aboutsummaryrefslogtreecommitdiff
path: root/gdb
diff options
context:
space:
mode:
authorChristian Biesinger <cbiesinger@google.com>2019-12-18 17:56:17 -0600
committerChristian Biesinger <cbiesinger@google.com>2019-12-19 13:12:30 -0600
commitd411762c45d66b64c5cbfc8a9f004b1f2e1fba4b (patch)
tree08c8638449195f1134ac8ede3d62a8929b6638aa /gdb
parent1cd4a20a27c430fdd0db8d5b154e9c7860e440f5 (diff)
downloadgdb-d411762c45d66b64c5cbfc8a9f004b1f2e1fba4b.zip
gdb-d411762c45d66b64c5cbfc8a9f004b1f2e1fba4b.tar.gz
gdb-d411762c45d66b64c5cbfc8a9f004b1f2e1fba4b.tar.bz2
Make the literal argument to pow a double, not an integer
Since pow takes doubles, pass 2.0 instead of 2 to pow (). Conveniently, this fixes the ambiguous call to pow on Solaris 11 with gcc 5.5 (gcc211 on the compile farm), which has a "using std::pow" directive in a system header, which brings in float/double/long double overloads. Fixes the build on Solaris with enable-targets=all. gdb/ChangeLog: 2019-12-19 Christian Biesinger <cbiesinger@google.com> * score-tdep.c (score7_analyze_prologue): Pass 2.0 instead of 2 to pow (). Change-Id: Ib18e7e4749ddcbff0727b72a31198f8cb84d1993
Diffstat (limited to 'gdb')
-rw-r--r--gdb/ChangeLog5
-rw-r--r--gdb/score-tdep.c6
2 files changed, 9 insertions, 2 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 8595b6e..60930a7 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,5 +1,10 @@
2019-12-19 Christian Biesinger <cbiesinger@google.com>
+ * score-tdep.c (score7_analyze_prologue): Pass 2.0 instead of
+ 2 to pow ().
+
+2019-12-19 Christian Biesinger <cbiesinger@google.com>
+
* tui/tui-source.c (tui_source_window::set_contents): Cast argument of
log10 to double to fix Solaris 11 with gcc 5.5.
diff --git a/gdb/score-tdep.c b/gdb/score-tdep.c
index 5ca763c..b8abe3d 100644
--- a/gdb/score-tdep.c
+++ b/gdb/score-tdep.c
@@ -918,13 +918,15 @@ score7_analyze_prologue (CORE_ADDR startaddr, CORE_ADDR pc,
&& G_FLD (inst->v, 2, 0) == 0x0)
{
/* subei! r0, n */
- sp_offset += (int) pow (2, G_FLD (inst->v, 6, 3));
+ sp_offset += (int) pow (2.0, G_FLD (inst->v, 6, 3));
}
else if (G_FLD (inst->v, 14, 7) == 0xc0
&& G_FLD (inst->v, 2, 0) == 0x0)
{
/* addei! r0, n */
- sp_offset -= (int) pow (2, G_FLD (inst->v, 6, 3));
+ /* Solaris 11+gcc 5.5 has ambiguous overloads of pow, so we
+ pass 2.0 instead of 2 to get the right one. */
+ sp_offset -= (int) pow (2.0, G_FLD (inst->v, 6, 3));
}
}
else