From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 924 invoked by alias); 30 Apr 2008 21:13:00 -0000 Received: (qmail 774 invoked by uid 48); 30 Apr 2008 21:12:14 -0000 Date: Wed, 30 Apr 2008 21:13:00 -0000 Message-ID: <20080430211214.773.qmail@sourceware.org> X-Bugzilla-Reason: CC References: Subject: [Bug target/35788] MIPS stack overflow caused by addui instruction In-Reply-To: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "rsandifo at gcc dot gnu dot org" Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2008-04/txt/msg02177.txt.bz2 ------- Comment #9 from rsandifo at gcc dot gnu dot org 2008-04-30 21:12 ------- Sorry, I don't understand what you think the bug is. You say: > For some reason the compiler allocates > memory on the stack by issuing a Addui sp,sp with some negative number, however > the negative number is only sixteen bits and therefore because the instruction > is an add unsigned immediate this negative number gets treated like a positve > number. But you seem to misunderstand how the MIPS addiu instruction works. The 16-bit immediate operand is sign-extended. Do you actually get an execution failure? Richard -- rsandifo at gcc dot gnu dot org changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |rsandifo at gcc dot gnu dot | |org http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35788