Bug spotted on the 4.7 branch, exposed by the test-case as far back as the 4.4 branch r186831. Test-case to be attached, need a PR number.
Created attachment 27337 [details] testcase to be compiled with -O2 The effect of the bug is to eliminate the NULL-pointer check for rtc->ops->f and always call it, which is not a good idea when it is NULL. Test-case derived from a Linux driver. Unfortunately, presence of a main function makes the bug hide by slightly changing the generated code, so I have to put the framework in a separate file to make a runnable test-case. This is a secondary bug, for which I will clone a PR from this PR: with the marker-asms and attributes noclone, noinline, there should be no need for that. It seems static branch predictions change.
Author: hp Date: Tue May 8 15:20:52 2012 New Revision: 187283 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=187283 Log: PR target/53272 * config/cris/cris.c (cris_normal_notice_update_cc): For TARGET_V32, when a constant source operand matches an "I" constraint, the "no CC0 change" applies to a register-destination only, not a strict_low_part-destination. Modified: trunk/gcc/ChangeLog trunk/gcc/config/cris/cris.c
Author: hp Date: Tue May 8 15:21:50 2012 New Revision: 187284 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=187284 Log: PR target/53272 * gcc.dg/torture/pr53272-1.c, gcc.dg/torture/pr53272-2.c: New test. Added: trunk/gcc/testsuite/gcc.dg/torture/pr53272-1.c trunk/gcc/testsuite/gcc.dg/torture/pr53272-2.c Modified: trunk/gcc/testsuite/ChangeLog
Author: hp Date: Tue May 8 15:27:03 2012 New Revision: 187285 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=187285 Log: PR target/53272 * config/cris/cris.c (cris_normal_notice_update_cc): For TARGET_V32, when a constant source operand matches an "I" constraint, the "no CC0 change" applies to a register-destination only, not a strict_low_part-destination. Modified: branches/gcc-4_7-branch/gcc/ChangeLog branches/gcc-4_7-branch/gcc/config/cris/cris.c
Author: hp Date: Tue May 8 15:27:58 2012 New Revision: 187286 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=187286 Log: PR target/53272 * gcc.dg/torture/pr53272-1.c, gcc.dg/torture/pr53272-2.c: New test. Added: branches/gcc-4_7-branch/gcc/testsuite/gcc.dg/torture/pr53272-1.c branches/gcc-4_7-branch/gcc/testsuite/gcc.dg/torture/pr53272-2.c Modified: branches/gcc-4_7-branch/gcc/testsuite/ChangeLog
target-bug fixed, no further backports intended.
oops, have to actually change to "resolved, fixed" too.