dinuxbg / gnupru

GCC and Binutils port for the TI PRU I/O processor
89 stars 11 forks source link

Missed optimization: Signed comparison with zero emits one more unneeded instruction #18

Closed dinuxbg closed 8 years ago

dinuxbg commented 8 years ago

The following C fragment:

    if (x < 0)
        ..

outputs the following instructions:

        qbbs    .L3, r17, 31
        qbgt    .L3, r17, 0

While completely harmless, the second instruction is obviously not needed when comparing with zero.