[m-rev.] diff: workaround problem with GCC 4.9
Julien Fischer
jfischer at opturion.com
Tue Sep 2 09:32:22 AEST 2014
This diff is fairly insignificant, however it has allowed me to
bootcheck the compiler in the asm_fast.gc grade on OS X, which to the
best of my knowledge is the first time that has ever worked. I'll do (a
lot) more testing of the asm_fast grades on OS X, and if they work
properly enable them.
---------------
Workaround a problem with GCC 4.9 on x86_64 systems.
configure.ac:
Apply the same workaround for a problem with GCC labels
on x86_64 systems with GCC 4.9 as we do with GCC 4.8.
(XXX we should probably disable -ftree-dominator-opts on all
GCCs that support it, but I'm not sure how widespread the problem
with it is -- I'll look into that separately.)
runtime/mercury_stack_trace.c:
Avoid a warning from GCC.
Julien.
diff --git a/configure.ac b/configure.ac
index a1580b6..20285b1 100644
--- a/configure.ac
+++ b/configure.ac
@@ -2506,11 +2506,12 @@ case "$ac_cv_prog_gcc" in yes)
CFLAGS_FOR_GOTOS="$CFLAGS_FOR_GOTOS -fomit-frame-pointer"
;;
i*86-*|x86_64*)
- # On x86-64 with GCC 4.8, gcc labels do not work correctly with
- # -ftree-dominator-opts -- we disable it for x86 in this case too.
+ # On x86-64 with GCC 4.8 and 4.9 gcc labels do not work correctly
+ # with -ftree-dominator-opts -- we disable it for x86 in this case
+ # too.
#
case "$C_COMPILER_TYPE" in
- gcc_4_8_*)
+ gcc_4_8_*|gcc_4_9_*)
CFLAGS_FOR_GOTOS="$CFLAGS_FOR_GOTOS -fno-tree-dominator-opts"
;;
esac
diff --git a/runtime/mercury_stack_trace.c b/runtime/mercury_stack_trace.c
index 708adee..9cc6d25 100644
--- a/runtime/mercury_stack_trace.c
+++ b/runtime/mercury_stack_trace.c
@@ -1265,7 +1265,8 @@ MR_dump_nondet_stack_from_layout(FILE *fp,
} else {
frame_size = apparent_frame_size;
MR_print_nondetstackptr(fp, base_maxfr);
- fprintf(fp, ": ordinary, %d words", frame_size);
+ fprintf(fp, ": ordinary, %" MR_INTEGER_LENGTH_MODIFIER "d words",
+ frame_size);
if (print_vars && MR_find_matching_branch(base_maxfr, &branch)) {
fprintf(fp, ", ");
label_layout = MR_nondet_branch_infos[branch].branch_layout;
More information about the reviews
mailing list