Linaro GCC 4.5 switch optimization breaks profiled bootstrap

Bug #771900 reported by Ulrich Weigand
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Linaro GCC
Won't Fix
Medium
Andrew Stubbs

Bug Description

This bug was split off LP #759409 to track one of the failures discussed there:

Michael Hope wrote on 2011-04-13:

Running a profiled bootstrap of gcc-linaro-4.5+bzr99492 on i686 fails in a couple of places:

http://ex.seabright.co.nz/build/gcc-linaro-4.5+bzr99492%5Eprofiled/logs/i686-lucid-cbuild109-scorpius-profiled/gcc-build.txt
  ../../../gcc-linaro-4.5/gcc/c-opts.c -o c-opts.o
../../../gcc-linaro-4.5/gcc/c-opts.c: In function 'c_common_handle_option':
../../../gcc-linaro-4.5/gcc/c-opts.c:1673:5: internal compiler error: Floating point exception

../../../gcc-linaro-4.5/gcc/config/i386/predicates.md: In function 'fcmov_comparison_operator':
../../../gcc-linaro-4.5/gcc/config/i386/predicates.md:975:3: internal compiler error: Floating point exception

../../../gcc-linaro-4.5/gcc/gcse.c: In function 'oprs_not_set_p':
../../../gcc-linaro-4.5/gcc/gcse.c:1933:3: internal compiler error: Floating point exception

../../../gcc-linaro-4.5/gcc/plugin.c: In function 'invoke_plugin_callbacks':
../../../gcc-linaro-4.5/gcc/plugin.c:476:3: internal compiler error: Floating point exception

../../../gcc-linaro-4.5/gcc/reload1.c: In function 'choose_reload_regs':
../../../gcc-linaro-4.5/gcc/reload1.c:6704:7: internal compiler error: Floating point exception

This is while running the all-stagefeedback-gcc stage. I see the same on x86_64 and will try it on armv7.

Michael Hope wrote on 2011-04-13:

I see similar on ARM:
 http://builds.linaro.org/toolchain/gcc-linaro-4.5+bzr99492%5Eprofiled/logs/armv7l-maverick-cbuild109-ursa1-cortexa9r1/gcc-build.txt

../../../gcc-linaro-4.5/gcc/gengtype.c: In function 'write_types_process_field':
../../../gcc-linaro-4.5/gcc/gengtype.c:2458:3: internal compiler error: in set_jump_prob, at stmt.c:2319

../../../gcc-linaro-4.5/gcc/read-rtl.c: In function 'apply_iterator_traverse':
../../../gcc-linaro-4.5/gcc/read-rtl.c:548:3: internal compiler error: Floating point exception

Michael Hope wrote on 2011-04-15:

gcc-linaro-4.6+bzr106732 bootstraps OK on i686.

Ulrich Weigand wrote on 2011-04-18:

I can confirm the failure with Linaro GCC 4.5. The problem is an integer division by zero in set_jump_prob, which is a new function added as part of a feature ported from the CodeSourcery tree:

2010-01-25 Tom de Vries <email address hidden>

        gcc/
        * stmt.c (emit_case_bit_tests): Change prototype.
        * stmt.c (struct case_bit_test): Add prob field.
        * stmt.c (get_label_prob): New function.
        * stmt.c (set_jump_prob): New function.
        * stmt.c (emit_case_bit_tests): Use get_label_prob.
        * stmt.c (emit_case_bit_tests): Set prob field.
        * stmt.c (emit_case_bit_tests): Use set_jump_prob.
        * stmt.c (expand_case): Add new args to emit_case_bit_tests invocation.
        * testsuite/gcc.dg/switch-prob.c: Add test.

This particular CodeSourcery backport is not (yet?) in Linaro GCC 4.6, therefore the problem cannot occur there.

Related branches

Revision history for this message
Andrew Stubbs (ams-codesourcery) wrote :

CodeSourcery has a fix for this. I'll get it merged.

Michael Hope (michaelh1)
Changed in gcc-linaro:
status: Triaged → Fix Committed
milestone: none → 4.5-2011.05-0
Revision history for this message
Michael Hope (michaelh1) wrote :

make profiledbootstrap on x86_64 on gcc-linaro-4.5-2011.05 still fails:

../../gcc-linaro-4.5-2011.05-0/gcc/config/i386/i386.c: In function ���ix86_legitimate_address_p���:
../../gcc-linaro-4.5-2011.05-0/gcc/config/i386/i386.c:9958:2: internal compiler error: in set_jump_prob, at stmt.c:2321

Changed in gcc-linaro:
status: Fix Committed → Triaged
milestone: 4.5-2011.05-0 → none
Revision history for this message
Michael Hope (michaelh1) wrote :

Andrew checked inside CSL and there's no update to the patch.

Revision history for this message
Michael Hope (michaelh1) wrote :

4.5 has gone into maintenance.

Changed in gcc-linaro:
status: Triaged → Won't Fix
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.