Re: Transformation of relational expression

2016-02-23 Thread Richard Biener
On Tue, Feb 23, 2016 at 11:39 AM, Dmytro Sheyko wrote: > Hello, > > I am compiling code like this: > > int test(int x, int eq, int lt, int gt) { > return x < 2000 ? lt : x > 2000 ? gt : eq; > } > > and expect that compiler would generate one CMP instruction for both > comparisons:

Transformation of relational expression

2016-02-23 Thread Dmytro Sheyko
Hello, I am compiling code like this: int test(int x, int eq, int lt, int gt) { return x < 2000 ? lt : x > 2000 ? gt : eq; } and expect that compiler would generate one CMP instruction for both comparisons: cmpl$2000, %edi jl .L37 jne .L38