This is the mail archive of the gcc-bugs@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]

[Bug tree-optimization/63302] [4.9 Regression] Code with 64-bit long long constants is miscompiled on 32-bit host


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63302

--- Comment #13 from Zhenqiang Chen <zhenqiang.chen at arm dot com> ---
For 4.9, some function optimizes the code as:

Optimizing range tests x_2 -[-2147483648, -2147483648] and -[0, 0]
 into (x_2 & 2147483647) != 0

For trunk, optimize_range_tests_diff optimizes the code as:

Optimizing range tests x_2 -[-2147483648, -2147483648] and -[0, 0]
 into (x_2 + 2147483648 & -2147483649) != 0

I tried to remove need_64bit_hwint=yes" from config.gcc to build i686. But it
does not build. So still need your help to idnetify the root cause.

Can you try to remove the line in tree-ssa-reassoc.c?

  any_changes |= optimize_range_tests_1 (opcode, first, length, true,
                                         ops, ranges);
And add a printf at the place:

  printf ("changes: %d\n", any_changes);


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