public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug optimization/10409] [ARM] "__attribute__((const))" apparently not working
[not found] <20030415035601.10409.gonz@ratloop.com>
@ 2003-06-04 0:22 ` dhazeghi@yahoo.com
2003-06-04 6:05 ` gonz@ratloop.com
` (4 subsequent siblings)
5 siblings, 0 replies; 6+ messages in thread
From: dhazeghi@yahoo.com @ 2003-06-04 0:22 UTC (permalink / raw)
To: gcc-bugs
PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=10409
dhazeghi@yahoo.com changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |WAITING
GCC build triplet| |i686-pc-cygwin
GCC host triplet| |i686-pc-cygwin
GCC target triplet| |arm-elf
------- Additional Comments From dhazeghi@yahoo.com 2003-06-04 00:22 -------
Hello,
with gcc 3.2.3 and 3.3 branch, I see the seem behavior that you do. With gcc mainline, I only get
one call to pure_func. Would it be possible for you to check whether this works for you too with
gcc mainline (cvs), or to confirm whether the following assembly is correct:
.file "test.c"
.text
.align 2
.global test
.type test, %function
test:
@ args = 0, pretend = 0, frame = 0
@ frame_needed = 1, uses_anonymous_args = 0
mov ip, sp
stmfd sp!, {fp, ip, lr, pc}
sub fp, ip, #4
bl pure_func
mov r0, r0, asl #1
ldmea fp, {fp, sp, pc}
.size test, .-test
.ident "GCC: (GNU) 3.4 20030603 (experimental)"
Thanks,
Dara
------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug optimization/10409] [ARM] "__attribute__((const))" apparently not working
[not found] <20030415035601.10409.gonz@ratloop.com>
2003-06-04 0:22 ` [Bug optimization/10409] [ARM] "__attribute__((const))" apparently not working dhazeghi@yahoo.com
@ 2003-06-04 6:05 ` gonz@ratloop.com
2003-06-04 6:42 ` dhazeghi@yahoo.com
` (3 subsequent siblings)
5 siblings, 0 replies; 6+ messages in thread
From: gonz@ratloop.com @ 2003-06-04 6:05 UTC (permalink / raw)
To: gcc-bugs
PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=10409
gonz@ratloop.com changed:
What |Removed |Added
----------------------------------------------------------------------------
GCC host triplet|i686-pc-cygwin |i686-pc-ddd
------- Additional Comments From gonz@ratloop.com 2003-06-04 06:04 -------
Thanks Dara,
The assembly code you pasted looks correct, however, it is pushing
a lot of unneccessary registers. Was this compiled with "-O2"?
I would definitely like to test the latest 3.4 sources, but it's
going to take me a few weeks to allocate the time. If 3.4 fixes
the problem, then we could close this bug.
-Pete
------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug optimization/10409] [ARM] "__attribute__((const))" apparently not working
[not found] <20030415035601.10409.gonz@ratloop.com>
2003-06-04 0:22 ` [Bug optimization/10409] [ARM] "__attribute__((const))" apparently not working dhazeghi@yahoo.com
2003-06-04 6:05 ` gonz@ratloop.com
@ 2003-06-04 6:42 ` dhazeghi@yahoo.com
2003-06-04 7:43 ` gonz@ratloop.com
` (2 subsequent siblings)
5 siblings, 0 replies; 6+ messages in thread
From: dhazeghi@yahoo.com @ 2003-06-04 6:42 UTC (permalink / raw)
To: gcc-bugs
PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=10409
dhazeghi@yahoo.com changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|WAITING |NEW
Ever Confirmed| |1
Last reconfirmed|0000-00-00 00:00:00 |2003-06-04 06:42:46
date| |
------- Additional Comments From dhazeghi@yahoo.com 2003-06-04 06:42 -------
Yes, this was compiled with -O2. -O3 doesn't change it either. Actually, when I try it with -O0, the
problem returns. Furthermore, if I try the testcase on powerpc-darwin, the problem's there at all
optimization levels. Looks like this one's still a bug (though not only in your specific case)...
Dara
------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug optimization/10409] [ARM] "__attribute__((const))" apparently not working
[not found] <20030415035601.10409.gonz@ratloop.com>
` (2 preceding siblings ...)
2003-06-04 6:42 ` dhazeghi@yahoo.com
@ 2003-06-04 7:43 ` gonz@ratloop.com
2003-06-05 13:59 ` [Bug optimization/10409] " rearnsha@gcc.gnu.org
2003-06-08 16:23 ` pinskia@physics.uc.edu
5 siblings, 0 replies; 6+ messages in thread
From: gonz@ratloop.com @ 2003-06-04 7:43 UTC (permalink / raw)
To: gcc-bugs
PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=10409
------- Additional Comments From gonz@ratloop.com 2003-06-04 07:43 -------
I would expect the problem to occur with -O0, since folding pure functions is a
common subexpression optimization, not a semantics issue.
Regarding my previous comments about the assembly langauge, I should note that
under GCC 3.2.3, this code:
int test(int x) {
return pure_func(x) << 1;
}
...produces this output:
.size _Z8testorigi,.Lfe1-_Z8testorigi
.align 2
.global _Z4testi
.type _Z4testi,function
_Z4testi:
@ Function supports interworking.
@ args = 0, pretend = 0, frame = 0
@ frame_needed = 1, uses_anonymous_args = 0
mov ip, sp
stmfd sp!, {fp, ip, lr, pc}
sub fp, ip, #4
bl _Z9pure_funci
mov r0, r0, asl #1
ldmea fp, {fp, sp, lr}
bx lr
...which is nearly identical to the code you pasted, and therefore GCC 3.4 is
doing the right thing. If "-fomit-frame-pointer" is failing to eliminate those
extra pushes, it is a totally unrelated bug.
Therefore, it seems your most significant finding is that powerpc-darwin is
still has the problem.
-Pete
------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug optimization/10409] "__attribute__((const))" apparently not working
[not found] <20030415035601.10409.gonz@ratloop.com>
` (3 preceding siblings ...)
2003-06-04 7:43 ` gonz@ratloop.com
@ 2003-06-05 13:59 ` rearnsha@gcc.gnu.org
2003-06-08 16:23 ` pinskia@physics.uc.edu
5 siblings, 0 replies; 6+ messages in thread
From: rearnsha@gcc.gnu.org @ 2003-06-05 13:59 UTC (permalink / raw)
To: gcc-bugs
PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=10409
rearnsha@gcc.gnu.org changed:
What |Removed |Added
----------------------------------------------------------------------------
Severity|normal |enhancement
Keywords| |pessimizes-code
Summary|[ARM] |"__attribute__((const))"
|"__attribute__((const))" |apparently not working
|apparently not working |
------- Additional Comments From rearnsha@gcc.gnu.org 2003-06-05 13:59 -------
It is not incorrect to fail to remove duplicate calls to "const" functions. So
at best this is an enhancement request. As noted elsewhere, this is a
shortcoming in our CSE.
------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug optimization/10409] "__attribute__((const))" apparently not working
[not found] <20030415035601.10409.gonz@ratloop.com>
` (4 preceding siblings ...)
2003-06-05 13:59 ` [Bug optimization/10409] " rearnsha@gcc.gnu.org
@ 2003-06-08 16:23 ` pinskia@physics.uc.edu
5 siblings, 0 replies; 6+ messages in thread
From: pinskia@physics.uc.edu @ 2003-06-08 16:23 UTC (permalink / raw)
To: gcc-bugs
PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=10409
pinskia@physics.uc.edu changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |RESOLVED
Resolution| |FIXED
------- Additional Comments From pinskia@physics.uc.edu 2003-06-08 16:23 -------
This is fixed on the mainline (20030608) for powerpc-darwin and powerpc-aix (which
was filled as a different bug) and arm-elf and ix86-pc-linux-gnu.
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2003-06-08 16:23 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
[not found] <20030415035601.10409.gonz@ratloop.com>
2003-06-04 0:22 ` [Bug optimization/10409] [ARM] "__attribute__((const))" apparently not working dhazeghi@yahoo.com
2003-06-04 6:05 ` gonz@ratloop.com
2003-06-04 6:42 ` dhazeghi@yahoo.com
2003-06-04 7:43 ` gonz@ratloop.com
2003-06-05 13:59 ` [Bug optimization/10409] " rearnsha@gcc.gnu.org
2003-06-08 16:23 ` pinskia@physics.uc.edu
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).