14715 – [3.4 only] Altivec stack layout may overlap gpr save with stack temps (original) (raw)

Description David Eger 2004-03-24 12:12:28 UTC

When trying to build mozilla-1.6-r1 (on gentoo) the build dies with the following error message:

gcc -o jsobj.o -c -DOSTYPE="Linux2.4" -DOSARCH="Linux" -DEXPORT_JS_API -DJS_USE_SAFE_ARENA -I../../dist/include/js -I../../dist/include -I/var/tmp/portage/mozilla-1.6-r1/work/mozilla/dist/include/nspr -I. -I/usr/X11R6/include -fPIC -I/usr/X11R6/include -Wall -W -Wno-unused -Wpointer-arith -Wcast-align -Wno-long-long -O2 -pipe -mcpu=7450 -s -fforce-addr -fno-strict-aliasing -pthread -pipe -DNDEBUG -DTRIMMED -ffunction-sections -O2 -I/usr/X11R6/include -include ../../mozilla-config.h -DMOZILLA_CLIENT -Wp,-MD,.deps/jsobj.pp jsobj.c jsobj.c: In function `js_DefineNativeProperty': jsobj.c:2315: error: Attempt to delete prologue/epilogue insn: (insn/f 692 691 693 0 (nil) (set (mem:SI (plus:SI (reg/f:SI 1 r1) (const_int 32 [0x20])) [0 S4 A8]) (reg:SI 20 r20)) -1 (nil) (expr_list:REG_FRAME_RELATED_EXPR (set (mem:SI (plus:SI (reg/f:SI 1 r1) (const_int 32 [0x20])) [0 S4 A8]) (reg:SI 20 r20)) (nil))) jsobj.c:2315: internal compiler error: in propagate_one_insn, at flow.c:1741

make[3]: *** [jsobj.o] Error 1 make[3]: Leaving directory /var/tmp/portage/mozilla-1.6-r1/work/mozilla/js/src' make[2]: *** [libs] Error 2 make[2]: Leaving directory /var/tmp/portage/mozilla-1.6-r1/work/mozilla/js' make[1]: *** [tier_2] Error 2 make[1]: Leaving directory `/var/tmp/portage/mozilla-1.6-r1/work/mozilla' make: *** [default] Error 2

Comment 2 lu_zero 2004-04-07 12:20:46 UTC

the same issue reported on the latest snapshot from the 20040407. strangely enough seems that building with the -O2 avoid the issue, but produces wrong code.

Comment 3 lu_zero 2004-04-07 12:26:27 UTC

just to make life easyer: the gcc-3.3.3_pre${date} is the snapshot from the hammer-3_3-branch from the same date.

the problem is present on every mozilla and alwasy on the same file, I couldn't reduce it to a proper testcase yet

the bug seems to be trigger by the absence of -fstrict-aliasing (that's why -O2 doesn't show the problem but -O1 does)

Comment 4 Drea Pinski 2004-04-07 13:34:22 UTC

I cannot reproduce this on either the mainline or the 3.3 branch so it must only effect the hammer branch.

Comment 5 Alan Modra 2004-04-15 07:01:51 UTC

*** Bug 14953 has been marked as a duplicate of this bug. ***

Comment 6 Alan Modra 2004-04-15 07:52:40 UTC

From my preliminary analysis, I would guess that this bug affects 3.4 and 3.5 too, and it's just a matter of finding the right testcase.

With hammer branch, the underlying problem is that a stack temp is allocated to the same location as a gpr save slot. Flow analysis notices that the gpr save is overwritten, so decides that the gpr save is dead and should be deleted. This leads to the ICE.

Stack vars and temps are allocated at STARTING_FRAME_OFFSET, which rs6000.h defines as: #define STARTING_FRAME_OFFSET
(RS6000_ALIGN (current_function_outgoing_args_size,
TARGET_ALTIVEC ? 16 : 8) \

The first term of this expression accounts for parameter save area, but rs6000.c:rs6000_stack_info uses info_ptr->parm_size = RS6000_ALIGN (current_function_outgoing_args_size, 8);

It is the difference in alignment that results in stack layout errors. Note that this error may be masked by alignment of other elements of the stack.

Comment 8 Giovanni Bajo 2004-04-15 09:41:49 UTC

Alan, if you're positive that the patch is needed for 3.3 (non hammer), 3.4 and mainline as well, would you please update the bug summary to reflect that this is a indeed a regression?

Comment 12 Drea Pinski 2004-04-30 17:05:29 UTC

Fixed in 3.4.1.