public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
From: felix-gcc@fefe.de
To: gcc-gnats@gcc.gnu.org
Subject: target/9633: i386 SSE intrinsics generate wrong code when spilling to stack
Date: Sun, 09 Feb 2003 03:16:00 -0000	[thread overview]
Message-ID: <20030209030913.GA25258@codeblau.de> (raw)


>Number:         9633
>Category:       target
>Synopsis:       i386 SSE intrinsics generate wrong code when spilling xmm registers to stack
>Confidential:   no
>Severity:       critical
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          wrong-code
>Submitter-Id:   net
>Arrival-Date:   Sun Feb 09 03:16:00 UTC 2003
>Closed-Date:
>Last-Modified:
>Originator:     Fefe
>Release:        3.4 20030129 (experimental)
>Organization:
>Environment:
System: Linux hellhound 2.4.20-wolk4.0s-pre7 #2 Wed Jan 22 13:14:55 CET 2003 i686 AMD Athlon(tm) XP 2000+ AuthenticAMD GNU/Linux
Architecture: i686

	
host: i686-pc-linux-gnu
build: i686-pc-linux-gnu
target: i686-pc-linux-gnu
configured with: ./configure --program-transform-name=s/^/e/ --prefix=/opt/gcc --with-local-prefix=/usr/local --disable-nls : (reconfigured) ./configure --program-transform-name=s/^/e/ --prefix=/opt/gcc --with-local-prefix=/usr/local --disable-nls --enable-__cxa_atexit
>Description:
	When compiling SSE code without optimization (or when using it
	in a way that makes gcc think it needs to spill xmm registers to
	the stack), gcc will not make sure the stack is 16-byte aligned.
	That causes the SSE store instruction to generate a segmentation
	fault.  This behavior is in 3.1.1 (earliest I have) up to the
	current 3.4 CVS.
>How-To-Repeat:
	$ cat ssebug.c
	#include <xmmintrin.h>

	main() {
	  static float scale=32768.f;
	  __m128 Scale=_mm_load1_ps(&scale);
	}
	$ gcc -o ssebug ssebug.c -msse
	$ ./ssebug
	[segfault]
>Fix:
	align the stack variables.
	Since spilling to the stack in most cases negates the
	performance gain the programmer hopes for with SSE, I also
	suggest a compiler warning in this case.
>Release-Note:
>Audit-Trail:
>Unformatted:


                 reply	other threads:[~2003-02-09  3:16 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20030209030913.GA25258@codeblau.de \
    --to=felix-gcc@fefe.de \
    --cc=gcc-gnats@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).