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

--- Comment #7 from Georg-Johann Lay <gjl at gcc dot gnu.org> ---
Created attachment 58955
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=58955&action=edit
Reduced C test case

$ avr-gcc pr116389-red.c -S -Os -mmcu=avrtiny

struct T { int val; };

void f_int (int);
char* get_pos (void);
struct T* get_pT (void);

void func (char i)
{
    struct T t = * get_pT ();
    unsigned diff = get_pos () - &i;

    if (diff)
    {
        long val32 = t.val;
        if (get_pos ())
            val32 = diff;
        if (get_pos ())
            f_int (2 * val32);
    }
}

Reply via email to