------- Comment #1 from pinskia at gcc dot gnu dot org 2006-12-23 10:31 ------- For 4.0 and above your sample code works but that is a different issue. Here is a testcase which fails for 4.0 and above: int find_num(int i) { int arr[5] = {0, 1, 2, 3, 4}; return arr[i]; } ---- The problem is the scheduler is moving the load past the update of r1 which is invalid for the SYSV ABI to do as there is no red zone.
This has almost always been an issue since the rs6000 target was added and/or the scheduler was added. -- pinskia at gcc dot gnu dot org changed: What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |NEW Ever Confirmed|0 |1 GCC target triplet| |powerpc-linux-gnu powerpc- | |eabi Keywords| |wrong-code Last reconfirmed|0000-00-00 00:00:00 |2006-12-23 10:31:55 date| | Summary|Optimization flag -O2 |Optimization flag -O1 - |generate error stack |fschedule-insns2 cause red |operating code |zone to be used when there | |is none http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30282