Skip to contentSkip to conversation

reduce large stack usage

PATCH Manfred Spraul 2 participants 2 messages Mar 2, 2003

lore
Share & tools
lore
#0 lore raw
Quoted 4 lines · Arnd

The twofish one is obviously
broken, and I suspect huft_build/inflate_dynamic are the cause of the crashes I'm seeing during unpacking of initramfs.

What do you mean with broken? On i386, the function needs 32 byte stack + the space for register saving. It must be either a gcc bug, or a bug in your detection script - I don't see anything special in twofish_setkey.

--
Manfred

#1 lore raw
Quoted 4 lines · Manfred Spraul

What do you mean with broken? On i386, the function needs 32 byte stack
+ the space for register saving.
It must be either a gcc bug, or a bug in your detection script - I don't see anything special in twofish_setkey.

You are right that the code itself is not broken -- I did not read it properly at first. The stack frame gets small if I compile for s390x with -fno-schedule-insn, so I suppose that optimization does not work to well on this particular code. I'll try a different compiler tomorrow.

I can verify the 32 bytes on i386 with both gcc-3.2 and gcc-3.3-snapshot. However, when compiling i386 twofish with gcc-2.95, I get an 804 bytes stack frame. Other architectures are probably somewhere in between i386 and s390x here, so there should be done something about this.

	Arnd <><