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

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
     Ever confirmed|1                           |0
             Status|WAITING                     |UNCONFIRMED

--- Comment #4 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
  saved_stack.50_2 = __builtin_stack_save ();
  _ll_buf.24_379 = __builtin_alloca_with_align (/*size=*/32,
/*align(bits)=*/64);
  _pbuf_381 = &MEM[(struct log_msg *)_ll_buf.24_379].data;
  MEM[(const void * *)_ll_buf.24_379 + 24B] = "Error message example.";
  MEM[(union cbprintf_package_hdr *)&hdr] = 4;
  MEM[(union cbprintf_package_hdr *)_ll_buf.24_379 + 16B] = hdr;
  hdr ={v} {CLOBBER};
  MEM[(struct log_msg_desc *)&_desc] = 8256;
  z_log_msg_static_create (&log_const_syst, _desc, _pbuf_381, 0B);
  __builtin_stack_restore (saved_stack.50_2);




The alloca gets expanded as:
(insn 15 14 16 (set (reg/f:DI 31 sp)
        (plus:DI (reg/f:DI 31 sp)
            (const_int -32 [0xffffffffffffffe0])))
"/home/andyross/z/zephyr/samples/subsys/logging/syst/src/main.c":47:49 -1
     (nil))

(insn 16 15 17 (set (reg:DI 214)
        (reg/f:DI 88 virtual-stack-dynamic))
"/home/andyross/z/zephyr/samples/subsys/logging/syst/src/main.c":47:49 -1
     (nil))

(insn 17 16 18 (set (reg:DI 215)
        (plus:DI (reg:DI 214)
            (const_int 7 [0x7])))
"/home/andyross/z/zephyr/samples/subsys/logging/syst/src/main.c":47:49 -1
     (nil))

(insn 18 17 19 (set (reg:DI 216)
        (lshiftrt:DI (reg:DI 215)
            (const_int 3 [0x3])))
"/home/andyross/z/zephyr/samples/subsys/logging/syst/src/main.c":47:49 -1
     (expr_list:REG_EQUAL (udiv:DI (reg:DI 215)
            (const_int 8 [0x8]))
        (nil)))

(insn 19 18 20 (set (reg/f:DI 217)
        (ashift:DI (reg:DI 216)
            (const_int 3 [0x3])))
"/home/andyross/z/zephyr/samples/subsys/logging/syst/src/main.c":47:49 -1
     (nil))

(insn 20 19 0 (set (reg/f:DI 117 [ _ll_buf.24 ])
        (reg/f:DI 217))
"/home/andyross/z/zephyr/samples/subsys/logging/syst/src/main.c":47:49 -1
     (nil))


Which looks correct (64 bit aligned is 8 byte aligned).

Reply via email to