public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
* c/2394: -O2 -mcpu=ultrasparc can generate std's to non-8-byte aligned stack offsets
@ 2001-03-26 10:36 grubba
  0 siblings, 0 replies; only message in thread
From: grubba @ 2001-03-26 10:36 UTC (permalink / raw)
  To: gcc-gnats; +Cc: grubba

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 3378 bytes --]

>Number:         2394
>Category:       c
>Synopsis:       -O2 -mcpu=ultrasparc can generate std's to non-8-byte aligned stack offsets
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Mon Mar 26 10:36:01 PST 2001
>Closed-Date:
>Last-Modified:
>Originator:     Henrik Grubbström <grubba@roxen.com>
>Release:        gcc version 2.95.2 19991024 (release)
>Organization:
>Environment:
$ uname -svrmip
SunOS 5.8 Generic_108528-04 sun4u sparc SUNW,Ultra-80
>Description:
Compilation of the attached file generates the following code:

...
.stabn 68,0,86,.LLM74-gccbug
.LLM74:
.LLBE7:
	mov	%l1, %o1
	mov	%l0, %o0
	std	%f2, [%sp+92]
	mov	%l2, %o2
	mov	%l3, %o3
	st	%i1, [%sp+100]
	mov	%l4, %o4
	call	gccbug_1, 0
	mov	0, %o5
...

Note the std %f2, [%sp+92]. 92 (0x5c) is not a multiple of 8,
the std will thus cause a SIGBUS.
>How-To-Repeat:
Compile the attached file with
$ gcc -g -mcpu=ultrasparc -O2 -S gccbug.c -o gccbug.s
Search for the code following the stab for line 86.
>Fix:

>Release-Note:
>Audit-Trail:
>Unformatted:
----gnatsweb-attachment----
Content-Type: application/x-c-code; name="gccbug.c"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="gccbug.c"

CnN0cnVjdCBsaW5lX2xpc3QKewogICBzdHJ1Y3QgdmVydGV4ICphYm92ZSwqYmVsb3c7CiAgIGRv
dWJsZSBkeCwgZHk7CiAgIHN0cnVj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sKICAgc3RydWN0IGxpbmVfbGlzdCAqbGw9
KnBsbDsKICAgaW50IG10b2c7CgogICB3aGlsZSAobGwpCiAgIHsKICAgICAgaWYgKCAobGwtPmFi
b3ZlLT55IDwgeXApICYmCgkgICAoIChsbC0+eG1heD09eG1pbiAmJiBsbC0+eXhtYXg9PXlwKSB8
fAoJICAgICAobGwtPnhtaW49PXhtaW4gJiYgbGwtPnl4bWluPT15cCkgKSApCiAgICAgIHsKCSB0
b2c9IXRvZzsKICAgICAgfQogICAgICBsbD1sbC0+bmV4dDsKICAgfQoKCiAgIGlmICh0b2cpCiAg
IHsKICAgICAgZ2NjYnVnXzIoYnVmLHhtaW4seG1heCwxLjApOwogICB9CgogICByZXR1cm4gdG9n
Owp9Cgp2b2lkIGdjY2J1ZyhzdHJ1Y3QgbGluZV9saXN0ICpsbCwgICAgZG91YmxlICpidWYpCnsK
ICAgaW50IHk9MDsKICAgCiAgIHdoaWxlICgxKQogICB7CiAgICAgIGRvdWJsZSB5cCA9IHk7CiAg
ICAgIHN0cnVjdCBsaW5lX2xpc3QgKmM7CiAgICAgIGRvdWJsZSB4bWluLCB4bWF4OwogICAgICBp
bnQgdG9nPTA7CgogICAgICBjPWxsOwogICAgICB3aGlsZSAoYykKICAgICAgewoJIGM9Yy0+bmV4
dDsKICAgICAgfQoKCiAgICAgIHRvZyA9IGdjY2J1Z18xKHhtaW4seG1heCwmbGwsdG9nLHlwLGJ1
Zik7IC8qKioqKioqKioqKioqLwogICAgICB5Kys7CiAgIH0KfQo=


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2001-03-26 10:36 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-03-26 10:36 c/2394: -O2 -mcpu=ultrasparc can generate std's to non-8-byte aligned stack offsets grubba

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).