------- Additional Comments From pinskia at gcc dot gnu dot org 2005-02-08 20:02 ------- (In reply to comment #2) > Here's another one. This may be a different bug. Yes that is a different (but related) bug. The problem is now, what is definition of pure functions (for that testcase). Take the following: int *a; int *func_pure () __attribute__((pure)); int func_pure_2 () __attribute__((pure)); int *func_pure() { return a; } int func_pure_2() { return *a;} int i; int func_loop_3 (int arg) { int var = 0; i = 1; while (arg--) { if (func_pure ()) var = func_pure_2 (); } return var; } void abort (void);
int main() { int i; i = func_loop_3 (10); if (i) abort (); } Is func_pure_2 really pure and if it is, then we should change it so we can trap on it. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19828