This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: egcs problem by someone else


| static int f(int) __attribute__((const));
| 
| int main()
| {
|    int f1, f2, x;
|    x = 1; f1 = f(x);
|    x = 2; f2 = f(x);
|    if (f1 != 1 || f2 != 2)
|      abort ();
|    exit (0);
| }
| 
| static int f(int x) { return x; }
| ---
|  
| This works fine on my system - at least, it doesn't call abort(). 
| egcs-1.0.3a (2.90.29), i486, linux-2.1.108, binutils-2.1.9.0.7. Hope this
| helps someone.
| 
| Cheers,
| Alex

You must compile it with -O2

-- 
 Carlo Wood  <carlo@runaway.xs4all.nl>


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]