[Bug 1251169] [NEW] during compilation with -O2 a function call is moved to the wrong place

2013-11-14 Thread Shkarnikov Sergey
Public bug reported: OS: Ubuntu 12.04.3 LTS clang version: 3.0-6ubuntu3 In the attached code the function foo2 has a side effect on its second argument. So, despite the fact that value of v1 has been previously set to 0, foo1 sould return 0. But if this code was compiled with -O2 (or higher

[Bug 1250883] [NEW] Optimizer's mistake

2013-11-13 Thread Shkarnikov Sergey
Public bug reported: OS: Ubuntu 12.04.3 LTS gcc version: 4.6.3-1ubuntu5 It's a slightly modificated test case from gcc-4.6.3 testsuite (920612-1.c): int main(){  int a = 0;  if ((int)((~0u) (1 + a))+1 0)   abort();  exit(0); } It operates fine after compilation with -O0 or -O1 option (exit

[Bug 1250904] [NEW] variable is optimized out by mistake

2013-11-13 Thread Shkarnikov Sergey
Public bug reported: OS: Ubuntu 12.04.3 LTS gcc version: 4.6.3-1ubuntu5 It's a modificated test case from gcc-4.6.3 testsuite (reassoc-11.c): int main(int a, int b, int c, int d){  int e = (a ^ b) ^ (c ^ d);  int f = (c ^ a) ^ (b ^ d);  return ( * ((int *)(((long unsigned ) c) + (((long

[Bug 1250941] [NEW] optimization of a recursive function cause segmentation fault during execution (in very rare cases)

2013-11-13 Thread Shkarnikov Sergey
Public bug reported: OS: Ubuntu 12.04.3 LTS gcc version: 4.6.3-1ubuntu5 It's a modificated test case from gcc-4.6.3 testsuite (2412-2.c): int f(int a){ int x = (( a)[(( a % 10) * ( a % 10)) % 10) (((10 - ( a % 10)) * (10 - ( a % 10))) % 10))) * 314160879)]); if (x==0)