EGCS vs GCC performance
Toon Moene
toon@moene.indiv.nluug.nl
Tue Jan 20 14:54:00 GMT 1998
Richard Henderson <rth@cygnus.com> writes:
>> It is configured properly for EV5 machines for certain.
Harvey Stein writes:
> What about EV56s? I presume that the same config would
> be fine? And as of what date is the above the case?
> With egcs-1.0 on redhat 4.2 I found egcs producing code
> which ran about the same as gcc 2.7.2.1, sometimes a
> little slower (-O2 -mcpu=21164). I tried to build
> egcs-971225 & pre 1.0.1, but was unable to (because redhat
> 4.2's binutils (v 2.7.0.2-4) was too old, I guess).
> Presumably, for the same reason I couldn't use
> -mcpu=21164a with egcs-971225. How much of a difference
> does -mcpu=21164 vs -mcpu=21164a make?
Richard, are you aware of the following bug report [by
kanazawa@flab.fujitsu.co.jp (Kanazawa Yuzi) to egcs-bugs, d.d. Wed,
7 Jan 1998 20:25:05 +0900 (JST)]
As far as I can see, his criticism about TARGET_CPU_DEFAULT is
right, although I'm not sure enough of my knowledge about the C
preference rules for bit operations to say that his conclusions are
correct.
Here is his report:
====>
I compiled snapshot 971225 on RedHat 5.0 alpha
(alphaev5-unknown-linux-gnu-gcc). When I used the compiler, I noticed
that it generated code much slower than before. It appeared that the
compiler optimized the code for EV6, though the configuration said the
cpu is EV5.
This problem was caused by `TARGET_CPU_DEFAULT' definition created
by gcc/configure. In my case, TARGET_CPU_DEFAULT was defined like
this.
tm.h:
#define TARGET_CPU_DEFAULT MASK_CPU_EV5|MASK_GAS
It makes `alpha_cpu' wrong because the variable is set by the
following statement.
config/alpha/alpha.c:
alpha_cpu
= TARGET_CPU_DEFAULT & MASK_CPU_EV6 ? PROCESSOR_EV6
: (TARGET_CPU_DEFAULT & MASK_CPU_EV5 ? PROCESSOR_EV5 :
PROCESSOR_EV4);
Since TARGET_CPU_DEFAULT is not protected by parenthesis,
`TARGET_CPU_DEFAULT & MASK_CPU_EV6' is always true. Thus alpha_cpu is
set to PROCESSOR_EV6.
Here is my patch. Note that with this fix rather ugly definition
like (MASK_SUPPORT_ARCH|((MASK_CPU_EV5|MASK_BWX|TASK_MAX)|MASK_GAS))
can be generated. Does anybody mind that?
Wed Jan 7 14:08:47 1998 Kanazawa Yuzi <kanazawa@flab.fujitsu.co.jp>
* gcc/configure.in: Add parenthesis to some
target_cpu_default2 definitions.
--- gcc/configure.in.orig Thu Dec 25 08:55:51 1997
+++ gcc/configure.in Wed Jan 7 14:08:47 1998
@@ -2672,13 +2672,13 @@
alpha*-*-*)
case $machine in
alphaev6*)
-
target_cpu_default2="MASK_CPU_EV6|MASK_BXW|MASK_CIX|MASK_MAX"
+
target_cpu_default2="(MASK_CPU_EV6|MASK_BXW|MASK_CIX|MASK_MAX)"
;;
alphapca56*)
-
target_cpu_default2="MASK_CPU_EV5|MASK_BWX|TASK_MAX"
+
target_cpu_default2="(MASK_CPU_EV5|MASK_BWX|TASK_MAX)"
;;
alphaev56*)
-
target_cpu_default2="MASK_CPU_EV5|MASK_BWX"
+
target_cpu_default2="(MASK_CPU_EV5|MASK_BWX)"
;;
alphaev5*)
target_cpu_default2="MASK_CPU_EV5"
@@ -2691,7 +2691,7 @@
then
target_cpu_default2="MASK_GAS"
else
-
target_cpu_default2="${target_cpu_default2}|MASK_GAS"
+
target_cpu_default2="(${target_cpu_default2}|MASK_GAS)"
fi
fi
;;
====>
The usage of explicit parentheses is consistent the default-default
target ...
HTH,
Toon.
More information about the Gcc
mailing list