summaryrefslogtreecommitdiff
path: root/gnu
diff options
context:
space:
mode:
authorMiod Vallat <miod@cvs.openbsd.org>2004-12-30 20:27:35 +0000
committerMiod Vallat <miod@cvs.openbsd.org>2004-12-30 20:27:35 +0000
commit0106b1382190def11f13dbfaab2f76ad3960a8ea (patch)
tree54eb660afd8f847b1a1c40d0320d95b6828b6bd6 /gnu
parent4dd3077c4abb5ce9f264f4080a9bed0bfe948b3a (diff)
gcc 3.3.5 loop optimization will produce incorrect output on powerpc; a
victim of this being awk(1), which in turn caused some manual pages to be generated without dates at the bottom. Since this is fixed by the (invasive) loop optimization rewrite done for 3.4, we can not expect a 3.3 fix anytime soon, and the fix is non-trivial, so disable the failing section of code on powerpc only. This has the net effect of magically turning -O1 and -O2 into -Os as far as -floop-optimize is concerned. Problem spotted by deraadt@, researched by otto@ and yours truly; this workaround agreed by many.
Diffstat (limited to 'gnu')
-rw-r--r--gnu/usr.bin/gcc/gcc/config/rs6000/openbsd.h3
-rw-r--r--gnu/usr.bin/gcc/gcc/loop.c2
2 files changed, 4 insertions, 1 deletions
diff --git a/gnu/usr.bin/gcc/gcc/config/rs6000/openbsd.h b/gnu/usr.bin/gcc/gcc/config/rs6000/openbsd.h
index e0c18280072..17bd1cde2e6 100644
--- a/gnu/usr.bin/gcc/gcc/config/rs6000/openbsd.h
+++ b/gnu/usr.bin/gcc/gcc/config/rs6000/openbsd.h
@@ -91,4 +91,5 @@ Boston, MA 02111-1307, USA. */
default to using nm. */
#undef OBJECT_FORMAT_COFF
-
+/* Some code gets optimized incorrectly by move_movables() in loop.c */
+#define BROKEN_MOVE_MOVABLES_P
diff --git a/gnu/usr.bin/gcc/gcc/loop.c b/gnu/usr.bin/gcc/gcc/loop.c
index e61e3fe9842..85e4fcac974 100644
--- a/gnu/usr.bin/gcc/gcc/loop.c
+++ b/gnu/usr.bin/gcc/gcc/loop.c
@@ -1130,6 +1130,7 @@ scan_loop (loop, flags)
Generally this increases code size, so do not move moveables when
optimizing for code size. */
+#ifndef BROKEN_MOVE_MOVABLES_P
if (! optimize_size)
{
move_movables (loop, movables, threshold, insn_count);
@@ -1150,6 +1151,7 @@ scan_loop (loop, flags)
loop_max_reg = max_reg_num ();
}
}
+#endif
/* Now candidates that still are negative are those not moved.
Change regs->array[I].set_in_loop to indicate that those are not actually