From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 20562 invoked by alias); 10 May 2011 03:13:08 -0000 Received: (qmail 20543 invoked by uid 22791); 10 May 2011 03:13:06 -0000 X-SWARE-Spam-Status: No, hits=-2.5 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00,TW_BG,TW_CX,TW_GX,TW_LG X-Spam-Check-By: sourceware.org Received: from localhost (HELO gcc.gnu.org) (127.0.0.1) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 10 May 2011 03:12:53 +0000 From: "julien at cayzac dot name" To: gcc-bugs@gcc.gnu.org Subject: [Bug target/48941] New: [arm gcc] NEON: Stack pointer operations performed even tho stack is not accessed at all in function. X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: target X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: julien at cayzac dot name X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Changed-Fields: Message-ID: X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated Content-Type: text/plain; charset="UTF-8" MIME-Version: 1.0 Date: Tue, 10 May 2011 03:13:00 -0000 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: 2011-05/txt/msg00779.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48941 Summary: [arm gcc] NEON: Stack pointer operations performed even tho stack is not accessed at all in function. Product: gcc Version: 4.5.3 Status: UNCONFIRMED Severity: normal Priority: P3 Component: target AssignedTo: unassigned@gcc.gnu.org ReportedBy: julien@cayzac.name Created attachment 24218 --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=24218 Source showcasing the problem Using some float32x4x2_t temporaries, some stack space is allocated even though the temporaries are made registers and stack never gets accessed inside the function. See attachment for C source and a corresponding assembly, produced with: arm-elf-gcc-4.5 -O3 -march=armv7-a -mthumb -mfpu=neon -mfloat-abi=softfp -S -o - test.c | grep -vE '^[[:space:]]*[\.@].*$' (the grep is just there to remove lines of comments and directives) The problem also happens in C++. $ arm-elf-gcc-4.5 --version -v Using built-in specs. COLLECT_GCC=arm-elf-gcc-4.5 COLLECT_LTO_WRAPPER=/opt/local/libexec/gcc/arm-elf/4.5.0/lto-wrapper arm-elf-gcc-4.5 (GCC) 4.5.0 Copyright (C) 2010 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. Target: arm-elf Configured with: /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_cross_arm-elf-gcc/work/gcc-4.5.0/configure --prefix=/opt/local --infodir=/opt/local/share/info --mandir=/opt/local/share/man --target=arm-elf --program-prefix=arm-elf- --program-suffix=-4.5 --without-included-gettext --enable-obsolete --with-newlib --disable-__cxa_atexit --enable-multilib --enable-biendian --disable-libgfortran --with-gxx-include-dir=/opt/local/arm-elf/include/c++/4.5.0/ --enable-languages=c,c++,objc --build=x86_64-apple-darwin10 --enable-fpu Thread model: single gcc version 4.5.0 (GCC) COLLECT_GCC_OPTIONS='-fversion' '-v' /opt/local/libexec/gcc/arm-elf/4.5.0/cc1 -quiet -v -D__USES_INITFINI__ help-dummy -quiet -dumpbase help-dummy -auxbase help-dummy -version -fversion -o /var/folders/Gn/GnNf6VbPEc4MTtfs4l39zU+++TI/-Tmp-//cc1shhZd.s GNU C (GCC) version 4.5.0 (arm-elf) compiled by GNU C version 4.2.1 (Apple Inc. build 5666) (dot 3), GMP version 5.0.1, MPFR version 3.0.0-p8, MPC version 0.8.2 warning: MPFR header version 3.0.0-p8 differs from library version 3.0.1-p3. warning: MPC header version 0.8.2 differs from library version 0.9. GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072 COLLECT_GCC_OPTIONS='-fversion' '-v' /opt/local/lib/gcc/arm-elf/4.5.0/../../../../arm-elf/bin/as --version -o /var/folders/Gn/GnNf6VbPEc4MTtfs4l39zU+++TI/-Tmp-//ccuztVa3.o /var/folders/Gn/GnNf6VbPEc4MTtfs4l39zU+++TI/-Tmp-//cc1shhZd.s GNU assembler (Linux/GNU Binutils) 2.20.51.0.9.20100526 Copyright 2010 Free Software Foundation, Inc. This program is free software; you may redistribute it under the terms of the GNU General Public License version 3 or later. This program has absolutely no warranty. This assembler was configured for a target of `arm-elf'. COMPILER_PATH=/opt/local/libexec/gcc/arm-elf/4.5.0/:/opt/local/libexec/gcc/arm-elf/4.5.0/:/opt/local/libexec/gcc/arm-elf/:/opt/local/lib/gcc/arm-elf/4.5.0/:/opt/local/lib/gcc/arm-elf/:/opt/local/lib/gcc/arm-elf/4.5.0/../../../../arm-elf/bin/ LIBRARY_PATH=/opt/local/lib/gcc/arm-elf/4.5.0/:/opt/local/lib/gcc/arm-elf/4.5.0/../../../../arm-elf/lib/ COLLECT_GCC_OPTIONS='-fversion' '-v' /opt/local/libexec/gcc/arm-elf/4.5.0/collect2 -X --version /opt/local/lib/gcc/arm-elf/4.5.0/crti.o /opt/local/lib/gcc/arm-elf/4.5.0/crtbegin.o /opt/local/lib/gcc/arm-elf/4.5.0/../../../../arm-elf/lib/crt0.o -L/opt/local/lib/gcc/arm-elf/4.5.0 -L/opt/local/lib/gcc/arm-elf/4.5.0/../../../../arm-elf/lib /var/folders/Gn/GnNf6VbPEc4MTtfs4l39zU+++TI/-Tmp-//ccuztVa3.o --start-group -lgcc -lc --end-group /opt/local/lib/gcc/arm-elf/4.5.0/crtend.o /opt/local/lib/gcc/arm-elf/4.5.0/crtn.o GNU ld (Linux/GNU Binutils) 2.20.51.0.9.20100526 Copyright 2010 Free Software Foundation, Inc. This program is free software; you may redistribute it under the terms of the GNU General Public License version 3 or (at your option) a later version. This program has absolutely no warranty.