Comment 2 for bug 602285

Revision history for this message
Yao Qi (yao-codesourcery) wrote :

This bug is caused by this piece of code, which restricts unroll times. However, in these failed cases, unroll number should be at least 3.

config/arm/arm.c:
 1885 if (flag_unroll_loops == 2)
 1886 {
 1887 if (optimize == 2)
 1888 {
 1889 flag_unroll_loops = 1;
 1890 if (!PARAM_SET_P (PARAM_MAX_UNROLL_TIMES))
 1891 set_param_value ("max-unroll-times", 2);
 1892 }
 1893 else if (optimize > 2)
 1894 {
 1895 flag_unroll_loops = 1;
 1896 if (!PARAM_SET_P (PARAM_MAX_UNROLL_TIMES))
 1897 set_param_value ("max-unroll-times", 4);
 1898 }
 1899 else
 1900 flag_unroll_loops = 0;
 1901 }

There are two options to fix this issue,
1. Change 2 -> 3 in line 1891: set_param_value ("max-unroll-times", 3);
2. Define macro DRIVER_SELF_SPECS in gcc/config/arm/arm.h like this,
#define DRIVER_SELF_SPECS "%{!fno-unroll-loops:%{!funroll-loops: \
   -funroll-loops --param max-unroll-times=3}}

I've tested these two options separately, and see failures go away. Let me know which one do you prefer? or other thoughts to fix this bug are welcome also.