public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/14726] New: large array/struct initializer goes in wrong section
@ 2004-03-25  1:55 mrnobo1024 at yahoo dot com
  2004-03-25  2:32 ` [Bug c/14726] " pinskia at gcc dot gnu dot org
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: mrnobo1024 at yahoo dot com @ 2004-03-25  1:55 UTC (permalink / raw)
  To: gcc-bugs

When initializing a large "auto" array or struct, eg
void f() {
  int x[] = { 1,2,3,4,5,6,7,8,9,10,11,12,13,14 };
}

the data gets put in the .data section, but it can never actually get written 
to (only the local copy on the stack does) so it should be in .rodata

-- 
           Summary: large array/struct initializer goes in wrong section
           Product: gcc
           Version: 3.3.3
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: c
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: mrnobo1024 at yahoo dot com
                CC: gcc-bugs at gcc dot gnu dot org


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14726


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

* [Bug c/14726] large array/struct initializer goes in wrong section
  2004-03-25  1:55 [Bug c/14726] New: large array/struct initializer goes in wrong section mrnobo1024 at yahoo dot com
@ 2004-03-25  2:32 ` pinskia at gcc dot gnu dot org
  2004-03-25  3:04 ` mrnobo1024 at yahoo dot com
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-03-25  2:32 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2004-03-25 02:32 -------
What target is this on and what exact version (give the output of gcc -v)?  I cannot reproduce this on 
i686-pc-linux with gcc 3.2.3, 3.3.1, 3.5.0 (the mainline). But I can reproduce this with 3.0.4.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |wrong-code
      Known to fail|                            |3.0.4
      Known to work|                            |2.95.3 3.2.3 3.3.1 3.5.0
                   |                            |3.4.0


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14726


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

* [Bug c/14726] large array/struct initializer goes in wrong section
  2004-03-25  1:55 [Bug c/14726] New: large array/struct initializer goes in wrong section mrnobo1024 at yahoo dot com
  2004-03-25  2:32 ` [Bug c/14726] " pinskia at gcc dot gnu dot org
@ 2004-03-25  3:04 ` mrnobo1024 at yahoo dot com
  2004-03-25  4:49 ` bangerth at dealii dot org
  2004-03-25 13:49 ` bangerth at dealii dot org
  3 siblings, 0 replies; 5+ messages in thread
From: mrnobo1024 at yahoo dot com @ 2004-03-25  3:04 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From mrnobo1024 at yahoo dot com  2004-03-25 03:04 -------
(In reply to comment #1)
> What target is this on and what exact version (give the output of gcc -v)?  I 
cannot reproduce this on 
> i686-pc-linux with gcc 3.2.3, 3.3.1, 3.5.0 (the mainline). But I can 
reproduce this with 3.0.4.

Reading specs from C:/MINGW/BIN/../lib/gcc-lib/mingw32/3.3.3/specs
Configured with: ../gcc/configure --with-gcc --with-gnu-ld --with-gnu-as --host=
mingw32 --target=mingw32 --prefix=/mingw --enable-threads --disable-nls --enable
-languages=c,c++,f77,ada,objc,java --disable-win32-registry --disable-shared --e
nable-sjlj-exceptions --enable-libgcj --disable-java-awt --without-x --enable-ja
va-gc=boehm --disable-libgcj-debug --enable-interpreter --enable-hash-synchroniz
ation
Thread model: win32
gcc version 3.3.3 (mingw special)


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14726


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

* [Bug c/14726] large array/struct initializer goes in wrong section
  2004-03-25  1:55 [Bug c/14726] New: large array/struct initializer goes in wrong section mrnobo1024 at yahoo dot com
  2004-03-25  2:32 ` [Bug c/14726] " pinskia at gcc dot gnu dot org
  2004-03-25  3:04 ` mrnobo1024 at yahoo dot com
@ 2004-03-25  4:49 ` bangerth at dealii dot org
  2004-03-25 13:49 ` bangerth at dealii dot org
  3 siblings, 0 replies; 5+ messages in thread
From: bangerth at dealii dot org @ 2004-03-25  4:49 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From bangerth at dealii dot org  2004-03-25 04:49 -------
Richard recently fixed this. This PR is a duplicate of a report I filed 
maybe half a year ago. 
 
W. 

-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14726


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

* [Bug c/14726] large array/struct initializer goes in wrong section
  2004-03-25  1:55 [Bug c/14726] New: large array/struct initializer goes in wrong section mrnobo1024 at yahoo dot com
                   ` (2 preceding siblings ...)
  2004-03-25  4:49 ` bangerth at dealii dot org
@ 2004-03-25 13:49 ` bangerth at dealii dot org
  3 siblings, 0 replies; 5+ messages in thread
From: bangerth at dealii dot org @ 2004-03-25 13:49 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From bangerth at dealii dot org  2004-03-25 13:49 -------
The duplicate I was talking about is PR 12814. I verified that for 
this snippet: 
------------------- 
int f(int i) { 
  int x[] = { 1,2,3,4,5,6,7,8,9,10,11,12,13,14 }; 
  return x[i]; 
} 
------------------- 
we get this code on tree-ssa: 
------------------- 
	.file	"x.cc" 
	.section	.rodata 
	.align 32 
	.type	_ZZ1fiE3C.0, @object 
	.size	_ZZ1fiE3C.0, 56 
_ZZ1fiE3C.0: 
	.long	1 
	.long	2 
	.long	3 
	.long	4 
	.long	5 
	.long	6 
	.long	7 
	.long	8 
	.long	9 
	.long	10 
	.long	11 
	.long	12 
	.long	13 
	.long	14 
	.text 
	.align 2 
	.p2align 4,,15 
.globl _Z1fi 
	.type	_Z1fi, @function 
_Z1fi: 
... 
--------------------- 
Note that the constant is in .rodata 
 
W. 

*** This bug has been marked as a duplicate of 12814 ***

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|                            |DUPLICATE


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14726


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

end of thread, other threads:[~2004-03-25 13:49 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-03-25  1:55 [Bug c/14726] New: large array/struct initializer goes in wrong section mrnobo1024 at yahoo dot com
2004-03-25  2:32 ` [Bug c/14726] " pinskia at gcc dot gnu dot org
2004-03-25  3:04 ` mrnobo1024 at yahoo dot com
2004-03-25  4:49 ` bangerth at dealii dot org
2004-03-25 13:49 ` bangerth at dealii 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).