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

Tamar Christina <tnfchris at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |tnfchris at gcc dot gnu.org

--- Comment #8 from Tamar Christina <tnfchris at gcc dot gnu.org> ---
This is causing a glibc build failure on arm-none-Linux-gnueabihf, for some
reason I can only reproduce it native but not cross. Don't exactly know why...

configured with

```
--enable-languages=c,c++,fortran --target=arm-none-linux-gnueabihf
--build=arm-none-linux-gnueabihf --host=arm-none-linux-gnueabihf
--with-arch=armv7-a --with-fpu=neon --with-float=hard --with-mode=thumb
```

repro case

```
long long a;

void f () {
  if (a >= 9223372036854775807 - 1 + 400)
    for (;;)
      ;
}
```

compiled with

```
-c -O2 -Wno-maybe-uninitialized
```

Which gets combined by combine into

```
Trying 8 -> 10:
    8: r112:DI=0x800000000000018e
   10: {cc:CC_NCV=cmp(r113:DI,r112:DI);clobber scratch;}
      REG_DEAD r113:DI
      REG_DEAD r112:DI
      REG_EQUAL cmp(r113:DI,0x800000000000018e)
Successfully matched this instruction:
(parallel [
        (set (reg:CC_NCV 100 cc)
            (compare:CC_NCV (reg:DI 113 [ aD.5557 ])
                (const_int -9223372036854775410 [0x800000000000018e])))
        (clobber (scratch:SI))
    ])
allowing combination of insns 8 and 10
```

and then later is split into

```
(insn 51 50 11 2 (parallel [
            (set (reg:CC 100 cc)
                (compare:CC (reg:SI 3 r3 [ aD.5557+4 ])
                    (const_int -2147483648 [0xffffffff80000000])))
            (set (reg:SI 3 r3 [114])
                (minus:SI (plus:SI (reg:SI 3 r3 [ aD.5557+4 ])
                        (const_int -2147483648 [0xffffffff80000000]))
                    (ltu:SI (reg:CC_C 100 cc)
                        (const_int 0 [0]))))
        ]) "zic.i":4:6 -1
     (nil))
```

Which matches no instruction and so ICEs.  On a cross build this seems to get
split into

```
(insn 51 50 11 2 (parallel [
            (set (reg:CC 100 cc)
                (compare:CC (reg:SI 3 r3 [ aD.5557+4 ])
                    (const_int 2147483647 [0x7fffffff])))
            (set (reg:SI 3 r3 [114])
                (minus:SI (plus:SI (reg:SI 3 r3 [ aD.5557+4 ])
                        (const_int 2147483647 [0x7fffffff]))
                    (ltu:SI (reg:CC_C 100 cc)
                        (const_int 0 [0]))))
        ]) "zin.i":4:6 32 {*subsi3_carryin_compare_const}
     (nil))
```

So the constants seem to be different.

Reply via email to