public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/23631] New: construct to memory and memcpy instead of memset
@ 2005-08-30 10:24 etienne_lorrain at yahoo dot fr
2005-08-30 10:39 ` [Bug middle-end/23631] " pinskia at gcc dot gnu dot org
2005-08-30 10:40 ` pinskia at gcc dot gnu dot org
0 siblings, 2 replies; 7+ messages in thread
From: etienne_lorrain at yahoo dot fr @ 2005-08-30 10:24 UTC (permalink / raw)
To: gcc-bugs
A global .rodata constant is created in the following case
and then memcpy() to the variable in the stack, instead
of just calling the intended memset.
etienne@cygne:~/projet/gujin$ cat > tmp.c
int
sub (int i)
{
int array[1000000] = { 0 };
sub2 (&array[i]);
}
etienne@cygne:~/projet/gujin$ ~/projet/toolchain/bin/gcc -S -Os tmp.c -o tmp.s
etienne@cygne:~/projet/gujin$ cat tmp.s
.file "tmp.c"
.section .rodata
.align 32
.type C.0.1134, @object
.size C.0.1134, 4000000
C.0.1134:
.zero 4000000
.text
.globl sub
.type sub, @function
sub:
pushl %ebp
movl %esp, %ebp
pushl %ebx
subl $4000000, %esp
pushl $4000000
pushl $C.0.1134
leal -4000004(%ebp), %ebx
pushl %ebx
call memcpy
movl 8(%ebp), %eax
leal (%ebx,%eax,4), %eax
pushl %eax
call sub2
addl $16, %esp
movl -4(%ebp), %ebx
leave
ret
.size sub, .-sub
.ident "GCC: (GNU) 4.0.2 20050811 (prerelease)"
.section .note.GNU-stack,"",@progbits
etienne@cygne:~/projet/gujin$ ~/projet/toolchain/bin/gcc -v
Using built-in specs.
Target: i686-pc-linux-gnu
Configured with: ../configure --prefix=/home/etienne/projet/toolchain --enable-
l
anguages=c
Thread model: posix
gcc version 4.0.2 20050811 (prerelease)
See also the thread at:
http://gcc.gnu.org/ml/gcc/2005-08/msg00660.html
Thanks to Jim Wilson (GNU Tools Support, http://www.specifix.com) for the
reduced test case and the analysis of the bug in gcc@gcc.gnu.org list.
Etienne.
--
Summary: construct to memory and memcpy instead of memset
Product: gcc
Version: 4.0.2
Status: UNCONFIRMED
Severity: normal
Priority: P2
Component: c
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: etienne_lorrain at yahoo dot fr
CC: gcc-bugs at gcc dot gnu dot org
GCC build triplet: i686-pc-linux-gnu
GCC host triplet: i686-pc-linux-gnu
GCC target triplet: i686-pc-linux-gnu
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23631
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Bug middle-end/23631] construct to memory and memcpy instead of memset
2005-08-30 10:24 [Bug c/23631] New: construct to memory and memcpy instead of memset etienne_lorrain at yahoo dot fr
@ 2005-08-30 10:39 ` pinskia at gcc dot gnu dot org
2005-08-30 10:40 ` pinskia at gcc dot gnu dot org
1 sibling, 0 replies; 7+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-08-30 10:39 UTC (permalink / raw)
To: gcc-bugs
--
What |Removed |Added
----------------------------------------------------------------------------
Component|c |middle-end
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23631
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Bug middle-end/23631] construct to memory and memcpy instead of memset
2005-08-30 10:24 [Bug c/23631] New: construct to memory and memcpy instead of memset etienne_lorrain at yahoo dot fr
2005-08-30 10:39 ` [Bug middle-end/23631] " pinskia at gcc dot gnu dot org
@ 2005-08-30 10:40 ` pinskia at gcc dot gnu dot org
1 sibling, 0 replies; 7+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-08-30 10:40 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From pinskia at gcc dot gnu dot org 2005-08-30 10:39 -------
The issue is the same as PR 23477.
*** This bug has been marked as a duplicate of 23477 ***
--
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |RESOLVED
Resolution| |DUPLICATE
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23631
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Bug middle-end/23631] construct to memory and memcpy instead of memset
[not found] <bug-23631-1034@http.gcc.gnu.org/bugzilla/>
` (2 preceding siblings ...)
2006-01-23 9:56 ` etienne_lorrain at yahoo dot fr
@ 2006-01-23 16:16 ` pinskia at gcc dot gnu dot org
3 siblings, 0 replies; 7+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2006-01-23 16:16 UTC (permalink / raw)
To: gcc-bugs
------- Comment #5 from pinskia at gcc dot gnu dot org 2006-01-23 16:16 -------
Fixed in 4.1.0.
--
pinskia at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |RESOLVED
Resolution| |FIXED
Target Milestone|--- |4.1.0
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23631
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Bug middle-end/23631] construct to memory and memcpy instead of memset
[not found] <bug-23631-1034@http.gcc.gnu.org/bugzilla/>
2006-01-16 10:36 ` etienne_lorrain at yahoo dot fr
2006-01-20 20:51 ` pinskia at gcc dot gnu dot org
@ 2006-01-23 9:56 ` etienne_lorrain at yahoo dot fr
2006-01-23 16:16 ` pinskia at gcc dot gnu dot org
3 siblings, 0 replies; 7+ messages in thread
From: etienne_lorrain at yahoo dot fr @ 2006-01-23 9:56 UTC (permalink / raw)
To: gcc-bugs
------- Comment #4 from etienne_lorrain at yahoo dot fr 2006-01-23 09:56 -------
(In reply to comment #3)
> PR 23477 was fixed in 4.1.0 and not 4.0.3. This is still a dup of that bug.
> *** This bug has been marked as a duplicate of 23477 ***
For me, 23477 is fixed in "GCC: (GNU) 4.0.3 20051201 (prerelease) (Debian
4.0.2-5)" (this bug is in C++ so compile with g++); but the current bug 23631
is still present (use pure C).
Etienne.
--
etienne_lorrain at yahoo dot fr changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|RESOLVED |UNCONFIRMED
Resolution|DUPLICATE |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23631
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Bug middle-end/23631] construct to memory and memcpy instead of memset
[not found] <bug-23631-1034@http.gcc.gnu.org/bugzilla/>
2006-01-16 10:36 ` etienne_lorrain at yahoo dot fr
@ 2006-01-20 20:51 ` pinskia at gcc dot gnu dot org
2006-01-23 9:56 ` etienne_lorrain at yahoo dot fr
2006-01-23 16:16 ` pinskia at gcc dot gnu dot org
3 siblings, 0 replies; 7+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2006-01-20 20:51 UTC (permalink / raw)
To: gcc-bugs
------- Comment #3 from pinskia at gcc dot gnu dot org 2006-01-20 20:51 -------
PR 23477 was fixed in 4.1.0 and not 4.0.3. This is still a dup of that bug.
*** This bug has been marked as a duplicate of 23477 ***
--
pinskia at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |RESOLVED
Resolution| |DUPLICATE
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23631
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Bug middle-end/23631] construct to memory and memcpy instead of memset
[not found] <bug-23631-1034@http.gcc.gnu.org/bugzilla/>
@ 2006-01-16 10:36 ` etienne_lorrain at yahoo dot fr
2006-01-20 20:51 ` pinskia at gcc dot gnu dot org
` (2 subsequent siblings)
3 siblings, 0 replies; 7+ messages in thread
From: etienne_lorrain at yahoo dot fr @ 2006-01-16 10:36 UTC (permalink / raw)
To: gcc-bugs
------- Comment #2 from etienne_lorrain at yahoo dot fr 2006-01-16 10:36 -------
Same bug still present in gcc version 4.0.3 20051201 (prerelease) (Debian
4.0.2-5).
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23477 is itself corrected, but
this current bug has never been corrected.
--
etienne_lorrain at yahoo dot fr changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|RESOLVED |UNCONFIRMED
Resolution|DUPLICATE |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23631
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2006-01-23 16:16 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-08-30 10:24 [Bug c/23631] New: construct to memory and memcpy instead of memset etienne_lorrain at yahoo dot fr
2005-08-30 10:39 ` [Bug middle-end/23631] " pinskia at gcc dot gnu dot org
2005-08-30 10:40 ` pinskia at gcc dot gnu dot org
[not found] <bug-23631-1034@http.gcc.gnu.org/bugzilla/>
2006-01-16 10:36 ` etienne_lorrain at yahoo dot fr
2006-01-20 20:51 ` pinskia at gcc dot gnu dot org
2006-01-23 9:56 ` etienne_lorrain at yahoo dot fr
2006-01-23 16:16 ` pinskia at gcc dot gnu dot org
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).