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.
This commit is contained in:
Julien Fischer
2014-09-02 09:33:07 +10:00
parent 000fa27bbb
commit 9c6654a9ba
2 changed files with 6 additions and 4 deletions

View File

@@ -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

View File

@@ -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;