On 11/26/13 08:55, Paul Koning wrote:

On Nov 25, 2013, at 10:25 PM, Jan-Benedict Glaw <jbg...@lug-owl.de>
wrote:

Hi!

Build log at
http://toolchain.lug-owl.de/buildbot/show_build_details.php?id=40865



g++ -c -g -O2 -DIN_GCC -DCROSS_DIRECTORY_STRUCTURE -fno-exceptions -fno-rtti -fasynchronous-unwind-tables -W -Wall -Wno-narrowing -Wwrite-strings -Wcast-qual -Wmissing-format-attribute -pedantic -Wno-long-long -Wno-variadic-macros -Wno-overlength-strings -Werror -fno-common -DHAVE_CONFIG_H -I. -I. -I../../../gcc/gcc -I../../../gcc/gcc/. -I../../../gcc/gcc/../include -I../../../gcc/gcc/../libcpp/include -I/opt/cfarm/mpc/include -I../../../gcc/gcc/../libdecnumber -I../../../gcc/gcc/../libdecnumber/dpd -I../libdecnumber -I../../../gcc/gcc/../libbacktrace -o cfgexpand.o -MT cfgexpand.o -MMD -MP -MF ./.deps/cfgexpand.TPo ../../../gcc/gcc/cfgexpand.c
../../../gcc/gcc/cfgexpand.c: In function ‘basic_block_def*
expand_gimple_cond(basic_block, gimple)’:
../../../gcc/gcc/cfgexpand.c:2027:65: error: comparison is always
true due to limited range of data type [-Werror=type-limits] else
if (BRANCH_COST (optimize_insn_for_speed_p (), false) < 4) ^
cc1plus: all warnings being treated as errors make[2]: ***
[cfgexpand.o] Error 1

Interesting.  In the pdp11 target, BRANCH_COST is either 0 or 1.  So
yes, that comparison is always true.

Is there a requirement that all targets must have branch cost that
it, at least some of the time, 4 or greater?  If so, why?  If not,
then I suppose cfgexpand.c could be changed to defeat this message,
but how, or why?  In general, it seems perfectly reasonable to have
code guarded by conditions that may be always true, or always false.
That's what we have optimizers for.  Defeating such optimizations by
calling them an error seems like a bad idea.
No, there's no such requirement on the targets to have a branch cost > 4.

Jeff

Reply via email to