Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix gcc-4.7.4 and above led to device booting error
In gcc version updated to 4.7.4, when using standard optimization (-O2) compile code, our device exception reboot at runtime. When using gcc 4.8.0 and above, device could not even start, and this problem also appeared on lge mako. When I check gcc-4.9.3 official manual, I notice that ftree-xxx optimization may cause very serious problem. I tried to remove these -ftree-xxx optimization flag when compiling the kernel using gcc-4.9.3, I found -ftree- vrp led to the device can not start. gcc-4.9.3 manual is this description for -ftree-vrp: > Perform Value Range Propagation on trees. This is similar to the constant prop- agation pass, but instead of values, ranges of values are propagated. This allows the optimizers to remove unnecessary range checks like array bound checks and null pointer checks. This is enabled by default at ‘-O2’ and higher. Null pointer check elimination is only done if ‘-fdelete-null-pointer-checks’ is enabled. To fix errors, use -fno-tree-vrp when compiling the kernel. Signed-off-by: Andy Deng <theandy.deng@gmail.com>
- Loading branch information