public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
* optimization/7515: invalid inlining
@ 2002-08-06 20:26 drepper
0 siblings, 0 replies; 5+ messages in thread
From: drepper @ 2002-08-06 20:26 UTC (permalink / raw)
To: gcc-gnats
>Number: 7515
>Category: optimization
>Synopsis: invalid inlining
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: unassigned
>State: open
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Tue Aug 06 20:26:00 PDT 2002
>Closed-Date:
>Last-Modified:
>Originator: Ulrich Drepper
>Release: at least 2.96 and later
>Organization:
>Environment:
x86 Linux, but probably all others
>Description:
When -O3 is used gcc performs invalid inlining optimizations. Functions, which are not declared static or have a visibility != default must not be inlined. At least when generating code for ELF binaries. The semantic changes since 'foo' will not be looked up using the ELF symbol resolution rules which would allow interposition.
>How-To-Repeat:
Compile the attached code with -O3. The result is that 'foo' gets inlined.
>Fix:
Only inline if the function is static, has visibility != default, or possibly if a new function attribute or command line option is used.
>Release-Note:
>Audit-Trail:
>Unformatted:
----gnatsweb-attachment----
Content-Type: application/octet-stream; name="o3.c"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="o3.c"
aW50CmZvbyAoaW50IGEpCnsKICAgIHJldHVybiBhOwp9CgppbnQKYmFyIChpbnQgYSkKewogICAg
cmV0dXJuIGZvbyAoYSkgPT0gMTsKfQo=
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: optimization/7515: invalid inlining
@ 2002-08-30 19:46 rth
0 siblings, 0 replies; 5+ messages in thread
From: rth @ 2002-08-30 19:46 UTC (permalink / raw)
To: drepper, gcc-bugs, gcc-prs, geoffk, rth
Synopsis: invalid inlining
Responsible-Changed-From-To: geoffk->rth
Responsible-Changed-By: rth
Responsible-Changed-When: Fri Aug 30 19:43:04 2002
Responsible-Changed-Why:
.
State-Changed-From-To: analyzed->closed
State-Changed-By: rth
State-Changed-When: Fri Aug 30 19:43:04 2002
State-Changed-Why:
http://gcc.gnu.org/ml/gcc-patches/2002-08/msg01829.html
http://gcc.gnu.org/ml/gcc-patches/2002-08/msg01830.html
http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=7515
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: optimization/7515: invalid inlining
@ 2002-08-06 21:26 Ulrich Drepper
0 siblings, 0 replies; 5+ messages in thread
From: Ulrich Drepper @ 2002-08-06 21:26 UTC (permalink / raw)
To: geoffk; +Cc: gcc-prs
The following reply was made to PR optimization/7515; it has been noted by GNATS.
From: Ulrich Drepper <drepper@redhat.com>
To: Geoff Keating <geoffk@geoffk.org>
Cc: gcc-gnats@gcc.gnu.org
Subject: Re: optimization/7515: invalid inlining
Date: Tue, 06 Aug 2002 21:17:05 -0700
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Geoff Keating wrote:
> This is not a bug unless -fpic is used, since executables themselves
> will not have any symbols overriden, correct?
This assumes clueful programmers. Often code for DSO are compiled
without -fpic. Sometimes it gets forgotten. Other times people believe
the "PIC register prevents optimization" myth. The text relocations
DSOs and up with having often go completely unnoticed.
So, no, -fpic is no prerequisite for this being a bug.
- --
- ---------------. ,-. 1325 Chesapeake Terrace
Ulrich Drepper \ ,-------------------' \ Sunnyvale, CA 94089 USA
Red Hat `--' drepper at redhat.com `------------------------
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iD8DBQE9UJ9H2ijCOnn/RHQRAiJwAKCgut+4fC4Zoq3VUC2a/knlBz/pRACggv8B
gg0/a/wOdwawFNE4IOxUseg=
=Mdrw
-----END PGP SIGNATURE-----
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: optimization/7515: invalid inlining
@ 2002-08-06 21:16 Geoff Keating
0 siblings, 0 replies; 5+ messages in thread
From: Geoff Keating @ 2002-08-06 21:16 UTC (permalink / raw)
To: geoffk; +Cc: gcc-prs
The following reply was made to PR optimization/7515; it has been noted by GNATS.
From: Geoff Keating <geoffk@geoffk.org>
To: drepper@redhat.com
Cc: gcc-gnats@gcc.gnu.org
Subject: Re: optimization/7515: invalid inlining
Date: 06 Aug 2002 21:11:41 -0700
This is not a bug unless -fpic is used, since executables themselves
will not have any symbols overriden, correct?
--
- Geoffrey Keating <geoffk@geoffk.org> <geoffk@redhat.com>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: optimization/7515: invalid inlining
@ 2002-08-06 21:10 geoffk
0 siblings, 0 replies; 5+ messages in thread
From: geoffk @ 2002-08-06 21:10 UTC (permalink / raw)
To: drepper, gcc-bugs, gcc-prs, geoffk, nobody
Synopsis: invalid inlining
Responsible-Changed-From-To: unassigned->geoffk
Responsible-Changed-By: geoffk
Responsible-Changed-When: Tue Aug 6 21:10:33 2002
Responsible-Changed-Why:
Working on fix.
State-Changed-From-To: open->analyzed
State-Changed-By: geoffk
State-Changed-When: Tue Aug 6 21:10:33 2002
State-Changed-Why:
Reproduced with GCC 3.1 and -O3 -fpic.
http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=7515
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2002-08-31 2:43 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-08-06 20:26 optimization/7515: invalid inlining drepper
2002-08-06 21:10 geoffk
2002-08-06 21:16 Geoff Keating
2002-08-06 21:26 Ulrich Drepper
2002-08-30 19:46 rth
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).