This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug tree-optimization/83383] [8 Regression] Wrong code with a bunch of type conversion and ternary operators
- From: "jakub at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Tue, 12 Dec 2017 11:22:21 +0000
- Subject: [Bug tree-optimization/83383] [8 Regression] Wrong code with a bunch of type conversion and ternary operators
- Auto-submitted: auto-generated
- References: <bug-83383-4@http.gcc.gnu.org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83383
--- Comment #2 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Cleaned up testcase for testsuite, in C (so gcc.c-torture/execute/):
/* PR tree-optimization/83383 */
unsigned long long int a = 16ULL;
unsigned char b = 195;
unsigned long long int c = ~0ULL;
unsigned char d = 1;
unsigned long long int e[2] = { 3625445792498952486ULL, 0 };
unsigned long long int f[2] = { 0, 8985037393681294663ULL };
unsigned long long int g = 5052410635626804928ULL;
void
foo ()
{
a = ((signed char) a) < b;
c = (d ? e[0] : 0) - (f[1] * a ? 1 : g);
}
int
main()
{
foo ();
if (a != 1 || c != 3625445792498952485ULL)
__builtin_abort ();
return 0;
}