public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
* target/7842: [REGRESSION] sparc code gen bug
@ 2002-09-05 13:36 mattias
  0 siblings, 0 replies; 3+ messages in thread
From: mattias @ 2002-09-05 13:36 UTC (permalink / raw)
  To: gcc-gnats; +Cc: gustav


>Number:         7842
>Category:       target
>Synopsis:       [REGRESSION] sparc code gen bug
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          wrong-code
>Submitter-Id:   net
>Arrival-Date:   Thu Sep 05 13:36:00 PDT 2002
>Closed-Date:
>Last-Modified:
>Originator:     mattias@virtutech.se
>Release:        gcc-3.2
>Organization:
>Environment:
Solaris 8 on SPARC
>Description:
The tiny g() function in the attached testcase is miscompiled by gcc 3.2 (and 3.1, 3.0.4) with -O2 -mcpu=ultrasparc. The testcase returns nonzero if the bug is present.

This is a regression - the bug seems not to be present in gcc 2.95.3.

The code generated by 3.0.4 contains the instruction
    and %reg, -1, %reg
which is a no-op, but from inspection it looks like the compiler really wanted to AND with 0xffffffff. Gcc 3.{1,2} do not have this error but still generate wrong code.

The bug is especially evil because in certain contexts, it
may appear to work when single-stepping with a debugger. This depends on the register assignments, since the high 32 bits of local/input registers are trashed on cpu traps.
>How-To-Repeat:

>Fix:

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

dHlwZWRlZiB1bnNpZ25lZCBsb25nIGxvbmcgdWludDY0OwoKdm9pZCBnKHVpbnQ2NCB4LCBpbnQg
eSwgaW50IHosIHVpbnQ2NCAqcCkKewoJdW5zaWduZWQgdyA9ICgoeCA+PiB5KSAmIDB4ZmZmZmZm
ZmZVTEwpIDw8ICh6ICYgMHgxZik7CgkqcCB8PSAodyAmIDB4ZmZmZmZmZmZVTEwpIDw8IHo7Cn0K
CmludCBtYWluKHZvaWQpCnsKCXVpbnQ2NCBhID0gMDsKCWcoMHhkZWFkYmVlZjAxMjM0NTY3VUxM
LCAwLCAwLCAmYSk7CglyZXR1cm4gKGEgPT0gMHgwMTIzNDU2NykgPyAwIDogMTsKfQoKCgo=


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: target/7842: [REGRESSION] sparc code gen bug
@ 2002-09-26  3:27 davem
  0 siblings, 0 replies; 3+ messages in thread
From: davem @ 2002-09-26  3:27 UTC (permalink / raw)
  To: davem, gcc-bugs, gcc-prs, gustav, mattias

Synopsis: [REGRESSION] sparc code gen bug

State-Changed-From-To: analyzed->closed
State-Changed-By: davem
State-Changed-When: Thu Sep 26 03:27:15 2002
State-Changed-Why:
    Fixed, see audit trail.

http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=7842


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: target/7842: [REGRESSION] sparc code gen bug
@ 2002-09-26  3:22 davem
  0 siblings, 0 replies; 3+ messages in thread
From: davem @ 2002-09-26  3:22 UTC (permalink / raw)
  To: davem, gcc-bugs, gcc-prs, gustav, mattias, nobody

Synopsis: [REGRESSION] sparc code gen bug

Responsible-Changed-From-To: unassigned->davem
Responsible-Changed-By: davem
Responsible-Changed-When: Thu Sep 26 03:22:06 2002
Responsible-Changed-Why:
    I got it.
State-Changed-From-To: open->analyzed
State-Changed-By: davem
State-Changed-When: Thu Sep 26 03:22:06 2002
State-Changed-Why:
    config/sparc/sparc.c:set_extends() is buggy.

http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=7842


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2002-09-26 10:27 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-09-05 13:36 target/7842: [REGRESSION] sparc code gen bug mattias
2002-09-26  3:22 davem
2002-09-26  3:27 davem

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