public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
* Re: c/8546: ebx is not being preserve for inline asm if -fPIC
@ 2002-12-02 13:06 bangerth
  0 siblings, 0 replies; 3+ messages in thread
From: bangerth @ 2002-12-02 13:06 UTC (permalink / raw)
  To: daveb, gcc-bugs, gcc-prs, nobody

Synopsis: ebx is not being preserve for inline asm if -fPIC

State-Changed-From-To: open->analyzed
State-Changed-By: bangerth
State-Changed-When: Mon Dec  2 13:06:32 2002
State-Changed-Why:
    Confirmed, with 3.2.2pre and 3.3CVS. I'm not sure, though,
    whether it is allowed to do what you do, or not. I leave this
    to others.

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


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

* Re: c/8546: ebx is not being preserve for inline asm if -fPIC
@ 2002-12-19  9:27 ebotcazou
  0 siblings, 0 replies; 3+ messages in thread
From: ebotcazou @ 2002-12-19  9:27 UTC (permalink / raw)
  To: daveb, gcc-bugs, gcc-prs, nobody

Synopsis: ebx is not being preserve for inline asm if -fPIC

State-Changed-From-To: analyzed->closed
State-Changed-By: ebotcazou
State-Changed-When: Thu Dec 19 09:27:03 2002
State-Changed-Why:
    Clobbering %ebx is now illegal in PIC mode on mainline (which will likely become gcc 3.4).

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


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

* c/8546: ebx is not being preserve for inline asm if -fPIC
@ 2002-11-19 14:36 daveb
  0 siblings, 0 replies; 3+ messages in thread
From: daveb @ 2002-11-19 14:36 UTC (permalink / raw)
  To: gcc-gnats


>Number:         8546
>Category:       c
>Synopsis:       ebx is not being preserve for inline asm if -fPIC
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Tue Nov 12 06:06:05 PST 2002
>Closed-Date:
>Last-Modified:
>Originator:     Dave Benson <daveb@ffem.org>
>Release:        gcc-3.0 and gcc-3.2
>Organization:
>Environment:
intel i386, Debian GNU/Linux
>Description:
It appears that %ebx is used by gcc to access global variables 
when -fPIC is specified.  Hence %ebx should be preserved
if __asm__ inlines add "%ebx" to the clobber list.

However, %ebx guards are not being added, so the resulting code has undefined behavior.
>How-To-Repeat:
just run the attached script, which makes two tiny .c files, compiles, links and runs the result, which segfaults when i do it.
>Fix:
i don't the proper fix. but a workaround is to push/pop %ebx at the beginning and end of the assembly block.
>Release-Note:
>Audit-Trail:
>Unformatted:
----gnatsweb-attachment----
Content-Type: application/octet-stream; name="bug-script"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="bug-script"

CkdDQz1nY2MtMy4yCgpjYXQgPDwiRU9GIiA+IHQuYwojaW5jbHVkZSA8c3RkaW8uaD4KCnZvbGF0
aWxlIGludCB3aGF0ZXZlciA9IDM7CgppbnQgdGVzdF9saWIoKQp7CiAgZnByaW50ZihzdGRlcnIs
IiV1XG4iLCB3aGF0ZXZlcik7CiAgX19hc21fXyBfX3ZvbGF0aWxlICgKICAgICJtb3ZsICQwLCAl
JWVieFxuIgogICAgOgogICAgOgogICAgOiAiJWVieCIKICApOwogIGZwcmludGYoc3RkZXJyLCIl
dVxuIiwgd2hhdGV2ZXIpOwogIHJldHVybiAwOwp9CkVPRgoKY2F0IDw8RU9GID4gbWFpbi5jCnZv
aWQgdGVzdF9saWIoKTsKCmludCBtYWluKCkgeyB0ZXN0X2xpYigpOyByZXR1cm4gMDsgfQpFT0YK
CnNldCAtZSAteAokR0NDIC1EX1JFRU5UUkFOVCAtV2FsbCAtcGVkYW50aWMgLWMgdC5jICAtZlBJ
QyAtRFBJQyAtbyB0LmxvCiRHQ0MgLXNoYXJlZCAgdC5sbyAgIC1vIGxpYnQuc28KJEdDQyAtRF9S
RUVOVFJBTlQgLVdhbGwgLXBlZGFudGljIC1jIG1haW4uYyAgLWZQSUMgLURQSUMgLW8gbWFpbi5v
CiRHQ0MgLW8gdHR0IG1haW4ubyBsaWJ0LnNvCgpMRF9MSUJSQVJZX1BBVEg9LiAuL3R0dAo=


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

end of thread, other threads:[~2002-12-19 17:27 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-12-02 13:06 c/8546: ebx is not being preserve for inline asm if -fPIC bangerth
  -- strict thread matches above, loose matches on Subject: below --
2002-12-19  9:27 ebotcazou
2002-11-19 14:36 daveb

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