https://gcc.gnu.org/bugzilla/show_bug.cgi?id=116229
Andrew Pinski <pinskia at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Last reconfirmed| |2024-08-04 Ever confirmed|0 |1 Target Milestone|--- |15.0 Status|UNCONFIRMED |NEW Summary|wrong code at -Ofast |[15 Regression] wrong code |aarch64 due to missing fneg |at -Ofast aarch64 due to |to generate |missing fneg to generate |0x8000000000000000 |0x8000000000000000 --- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> --- Reduced a little further: ``` typedef __attribute__((__vector_size__ (8))) unsigned long V; V __attribute__((__noipa__)) foo (void) { return (V){ 0x8000000000000000 }; } V ref = (V){ 0x8000000000000000 }; int main () { V v = foo (); if (v[0] != ref[0]) __builtin_abort(); } ``` Late_combine2 does: ``` trying to combine definition of r32 in: 13: v0:V4SI=const_vector into: 14: v0:V2DF=-v0:V2DF successfully matched this instruction to *aarch64_simd_movv2df: (set (reg:V2DF 32 v0) (const_vector:V2DF [ (const_double:DF -0.0 [-0x0.0p+0]) repeated x2 ])) ``` Which is correct if it was V2DF but the issue is how split of: ``` (insn 10 5 11 2 (set (reg:DI 32 v0) (const_int -9223372036854775808 [0x8000000000000000])) "/app/example.cpp":7:1 -1 (expr_list:REG_EQUAL (const_int -9223372036854775808 [0x8000000000000000]) (nil))) ``` into: ``` (insn 13 5 14 2 (set (reg:V4SI 32 v0) (const_vector:V4SI [ (const_int 0 [0]) repeated x4 ])) "/app/example.cpp":7:1 -1 (nil)) (insn 14 13 11 2 (set (reg:V2DF 32 v0) (neg:V2DF (reg:V2DF 32 v0))) "/app/example.cpp":7:1 -1 (nil)) ``` Via `Splitting with gen_split_10 (aarch64.md:1488)` .