NetBSD-Bugs archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
Re: port-macppc/54827: alloca() is broken in gcc 8 on powerpc
The following reply was made to PR port-macppc/54827; it has been noted by GNATS.
From: Valery Ushakov <uwe%stderr.spb.ru@localhost>
To: gnats-bugs%netbsd.org@localhost
Cc: matthew green <mrg%eterna.com.au@localhost>
Subject: Re: port-macppc/54827: alloca() is broken in gcc 8 on powerpc
Date: Tue, 21 Jan 2020 17:18:19 +0300
On Mon, Jan 20, 2020 at 03:30:02 +0000, Valery Ushakov wrote:
> Actually, since we are stomping onto the first local variable I wonder
> if the one we want is RS6000_STARTING_FRAME_OFFSET that has the
> (TARGET_ALTIVEC || TARGET_VSX) ? 16 : 8 part.
The following diff seems to help though I haven't yet tested variable
length alloca. The diff overrides two additional macros that have
that 16 vs. 8 choice dependent on altivec to always use 16 to match
our STACK_BOUNDARY.
--- netbsd.h.~1.14.~ 2019-10-02 12:53:42.597881037 +0300
+++ netbsd.h 2020-01-21 16:45:53.231796140 +0300
@@ -142,6 +142,20 @@
#undef STACK_BOUNDARY
#define STACK_BOUNDARY 128
+/* XXX: uwe: override to match STACK_BOUNDARY */
+#undef RS6000_STARTING_FRAME_OFFSET
+#define RS6000_STARTING_FRAME_OFFSET \
+ (cfun->calls_alloca \
+ ? (RS6000_ALIGN (crtl->outgoing_args_size + RS6000_SAVE_AREA, 16)) \
+ : (RS6000_ALIGN (crtl->outgoing_args_size, 16) \
+ + RS6000_SAVE_AREA))
+
+/* XXX: uwe: override to match STACK_BOUNDARY */
+#undef STACK_DYNAMIC_OFFSET
+#define STACK_DYNAMIC_OFFSET(FUNDECL) \
+ RS6000_ALIGN (crtl->outgoing_args_size.to_constant () \
+ + STACK_POINTER_OFFSET, 16)
+
/* Use standard DWARF numbering for DWARF debugging information. */
#define RS6000_USE_DWARF_NUMBERING
-uwe
Home |
Main Index |
Thread Index |
Old Index