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]
Other format: [Raw text]

Is this FE bug or am I missing something?


Guys,

Small sample below fails (at least on 6.1) for multiple targets. The
difference between two functions start at the very first tree pass...

Please confirm that I'm not crazy and it's not supposed to be like this...

Thanks

--
#include "limits.h"
#include "stdio.h"

int* __attribute__((noinline)) f1(int* p, int x)
{
return &p[x + 1];
}

int* __attribute__((noinline)) f2(int*p, int x)
{
return &p[1 + x];
}

int P[10];

int main()
{
int x = INT_MAX;
if (f1(P, x) != f2(P, x)) {
printf("Error!\n");
abort();
}
}
--


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