public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/21454] New: const array doesn't live in the rodata section in C++
@ 2005-05-08 16:06 kazu at cs dot umass dot edu
  2005-05-09  0:06 ` [Bug c++/21454] " pluto at agmk dot net
                   ` (9 more replies)
  0 siblings, 10 replies; 11+ messages in thread
From: kazu at cs dot umass dot edu @ 2005-05-08 16:06 UTC (permalink / raw)
  To: gcc-bugs

Consider:

static const int array[] = { 0, 1, 2, 3 };

int
foo (unsigned int i)
{
  return array[i];
}

I get:

	.file	"test.cc"
	.text
	.align 2
	.p2align 2,,3
.globl _Z3fooj
	.type	_Z3fooj, @function
_Z3fooj:
.LFB2:
	movl	4(%esp), %eax
	movl	array(,%eax,4), %eax
	ret
.LFE2:
	.size	_Z3fooj, .-_Z3fooj
	.data
	.align 4
	.type	array, @object
	.size	array, 16
array:
	.long	0
	.long	1
	.long	2
	.long	3
	.ident	"GCC: (GNU) 4.1.0 20050508 (experimental)"
	.section	.note.GNU-stack,"",@progbits

Note ".data".  We could use ".rodata" for this array.

-- 
           Summary: const array doesn't live in the rodata section in C++
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Keywords: missed-optimization
          Severity: normal
          Priority: P2
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: kazu at cs dot umass dot edu
                CC: gcc-bugs at gcc dot gnu dot org


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


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

* [Bug c++/21454] const array doesn't live in the rodata section in C++
  2005-05-08 16:06 [Bug c++/21454] New: const array doesn't live in the rodata section in C++ kazu at cs dot umass dot edu
@ 2005-05-09  0:06 ` pluto at agmk dot net
  2005-05-09  0:16 ` pinskia at gcc dot gnu dot org
                   ` (8 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: pluto at agmk dot net @ 2005-05-09  0:06 UTC (permalink / raw)
  To: gcc-bugs



-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |pluto at agmk dot net


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


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

* [Bug c++/21454] const array doesn't live in the rodata section in C++
  2005-05-08 16:06 [Bug c++/21454] New: const array doesn't live in the rodata section in C++ kazu at cs dot umass dot edu
  2005-05-09  0:06 ` [Bug c++/21454] " pluto at agmk dot net
@ 2005-05-09  0:16 ` pinskia at gcc dot gnu dot org
  2005-05-09 20:35 ` [Bug c++/21454] [4.0/4.1 Regression] " pinskia at gcc dot gnu dot org
                   ` (7 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-05-09  0:16 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2005-05-09 00:16 -------
Confirmed.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|                            |1
   Last reconfirmed|0000-00-00 00:00:00         |2005-05-09 00:16:12
               date|                            |


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


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

* [Bug c++/21454] [4.0/4.1 Regression] const array doesn't live in the rodata section in C++
  2005-05-08 16:06 [Bug c++/21454] New: const array doesn't live in the rodata section in C++ kazu at cs dot umass dot edu
  2005-05-09  0:06 ` [Bug c++/21454] " pluto at agmk dot net
  2005-05-09  0:16 ` pinskia at gcc dot gnu dot org
@ 2005-05-09 20:35 ` pinskia at gcc dot gnu dot org
  2005-05-09 20:36 ` pinskia at gcc dot gnu dot org
                   ` (6 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-05-09 20:35 UTC (permalink / raw)
  To: gcc-bugs



-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|const array doesn't live in |[4.0/4.1 Regression] const
                   |the rodata section in C++   |array doesn't live in the
                   |                            |rodata section in C++
   Target Milestone|---                         |4.0.1
            Version|unknown                     |4.1.0


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


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

* [Bug c++/21454] [4.0/4.1 Regression] const array doesn't live in the rodata section in C++
  2005-05-08 16:06 [Bug c++/21454] New: const array doesn't live in the rodata section in C++ kazu at cs dot umass dot edu
                   ` (2 preceding siblings ...)
  2005-05-09 20:35 ` [Bug c++/21454] [4.0/4.1 Regression] " pinskia at gcc dot gnu dot org
@ 2005-05-09 20:36 ` pinskia at gcc dot gnu dot org
  2005-05-09 20:38 ` pinskia at gcc dot gnu dot org
                   ` (5 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-05-09 20:36 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2005-05-09 20:35 -------
*** Bug 21476 has been marked as a duplicate of this bug. ***

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |lars at trolltech dot com


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


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

* [Bug c++/21454] [4.0/4.1 Regression] const array doesn't live in the rodata section in C++
  2005-05-08 16:06 [Bug c++/21454] New: const array doesn't live in the rodata section in C++ kazu at cs dot umass dot edu
                   ` (3 preceding siblings ...)
  2005-05-09 20:36 ` pinskia at gcc dot gnu dot org
@ 2005-05-09 20:38 ` pinskia at gcc dot gnu dot org
  2005-05-09 20:41 ` pinskia at gcc dot gnu dot org
                   ` (4 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-05-09 20:38 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2005-05-09 20:38 -------
This broke after 20041211.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
      Known to fail|                            |4.0.0 4.1.0
      Known to work|                            |3.4.4


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


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

* [Bug c++/21454] [4.0/4.1 Regression] const array doesn't live in the rodata section in C++
  2005-05-08 16:06 [Bug c++/21454] New: const array doesn't live in the rodata section in C++ kazu at cs dot umass dot edu
                   ` (4 preceding siblings ...)
  2005-05-09 20:38 ` pinskia at gcc dot gnu dot org
@ 2005-05-09 20:41 ` pinskia at gcc dot gnu dot org
  2005-05-11 17:08 ` jakub at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-05-09 20:41 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2005-05-09 20:40 -------
(In reply to comment #3)
> This broke after 20041211.

But before 20050225, the branch date.

-- 


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


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

* [Bug c++/21454] [4.0/4.1 Regression] const array doesn't live in the rodata section in C++
  2005-05-08 16:06 [Bug c++/21454] New: const array doesn't live in the rodata section in C++ kazu at cs dot umass dot edu
                   ` (5 preceding siblings ...)
  2005-05-09 20:41 ` pinskia at gcc dot gnu dot org
@ 2005-05-11 17:08 ` jakub at gcc dot gnu dot org
  2005-05-17  6:52 ` cvs-commit at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: jakub at gcc dot gnu dot org @ 2005-05-11 17:08 UTC (permalink / raw)
  To: gcc-bugs



-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
         AssignedTo|unassigned at gcc dot gnu   |jakub at gcc dot gnu dot org
                   |dot org                     |
             Status|NEW                         |ASSIGNED
   Last reconfirmed|2005-05-09 00:16:12         |2005-05-11 17:08:12
               date|                            |


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


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

* [Bug c++/21454] [4.0/4.1 Regression] const array doesn't live in the rodata section in C++
  2005-05-08 16:06 [Bug c++/21454] New: const array doesn't live in the rodata section in C++ kazu at cs dot umass dot edu
                   ` (6 preceding siblings ...)
  2005-05-11 17:08 ` jakub at gcc dot gnu dot org
@ 2005-05-17  6:52 ` cvs-commit at gcc dot gnu dot org
  2005-05-17  7:11 ` cvs-commit at gcc dot gnu dot org
  2005-05-17 11:26 ` pinskia at gcc dot gnu dot org
  9 siblings, 0 replies; 11+ messages in thread
From: cvs-commit at gcc dot gnu dot org @ 2005-05-17  6:52 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From cvs-commit at gcc dot gnu dot org  2005-05-17 06:51 -------
Subject: Bug 21454

CVSROOT:	/cvs/gcc
Module name:	gcc
Changes by:	jakub@gcc.gnu.org	2005-05-17 06:51:48

Modified files:
	gcc/testsuite  : ChangeLog 
	gcc/cp         : ChangeLog 
	gcc/cp         : decl.c 
Added files:
	gcc/testsuite/g++.dg/opt: const4.C 

Log message:
	PR c++/21454
	* decl.c (maybe_deduce_size_from_array_init): Call
	cp_apply_type_quals_to_decl after completing array type.
	
	* g++.dg/opt/const4.C: New test.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/ChangeLog.diff?cvsroot=gcc&r1=1.5481&r2=1.5482
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/ChangeLog.diff?cvsroot=gcc&r1=1.4743&r2=1.4744
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/decl.c.diff?cvsroot=gcc&r1=1.1393&r2=1.1394
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/opt/const4.C.diff?cvsroot=gcc&r1=NONE&r2=1.1



-- 


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


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

* [Bug c++/21454] [4.0/4.1 Regression] const array doesn't live in the rodata section in C++
  2005-05-08 16:06 [Bug c++/21454] New: const array doesn't live in the rodata section in C++ kazu at cs dot umass dot edu
                   ` (7 preceding siblings ...)
  2005-05-17  6:52 ` cvs-commit at gcc dot gnu dot org
@ 2005-05-17  7:11 ` cvs-commit at gcc dot gnu dot org
  2005-05-17 11:26 ` pinskia at gcc dot gnu dot org
  9 siblings, 0 replies; 11+ messages in thread
From: cvs-commit at gcc dot gnu dot org @ 2005-05-17  7:11 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From cvs-commit at gcc dot gnu dot org  2005-05-17 07:10 -------
Subject: Bug 21454

CVSROOT:	/cvs/gcc
Module name:	gcc
Branch: 	gcc-4_0-branch
Changes by:	jakub@gcc.gnu.org	2005-05-17 07:10:40

Modified files:
	gcc/testsuite  : ChangeLog 
	gcc/cp         : ChangeLog 
	gcc/cp         : decl.c 
Added files:
	gcc/testsuite/g++.dg/opt: const4.C 

Log message:
	PR c++/21454
	* decl.c (maybe_deduce_size_from_array_init): Call
	cp_apply_type_quals_to_decl after completing array type.
	
	* g++.dg/opt/const4.C: New test.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-4_0-branch&r1=1.5084.2.182&r2=1.5084.2.183
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-4_0-branch&r1=1.4648.2.39&r2=1.4648.2.40
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/decl.c.diff?cvsroot=gcc&only_with_tag=gcc-4_0-branch&r1=1.1371.2.8&r2=1.1371.2.9
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/opt/const4.C.diff?cvsroot=gcc&only_with_tag=gcc-4_0-branch&r1=NONE&r2=1.1.2.1



-- 


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


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

* [Bug c++/21454] [4.0/4.1 Regression] const array doesn't live in the rodata section in C++
  2005-05-08 16:06 [Bug c++/21454] New: const array doesn't live in the rodata section in C++ kazu at cs dot umass dot edu
                   ` (8 preceding siblings ...)
  2005-05-17  7:11 ` cvs-commit at gcc dot gnu dot org
@ 2005-05-17 11:26 ` pinskia at gcc dot gnu dot org
  9 siblings, 0 replies; 11+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-05-17 11:26 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2005-05-17 11:26 -------
Fixed.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
         Resolution|                            |FIXED


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


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

end of thread, other threads:[~2005-05-17 11:26 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-05-08 16:06 [Bug c++/21454] New: const array doesn't live in the rodata section in C++ kazu at cs dot umass dot edu
2005-05-09  0:06 ` [Bug c++/21454] " pluto at agmk dot net
2005-05-09  0:16 ` pinskia at gcc dot gnu dot org
2005-05-09 20:35 ` [Bug c++/21454] [4.0/4.1 Regression] " pinskia at gcc dot gnu dot org
2005-05-09 20:36 ` pinskia at gcc dot gnu dot org
2005-05-09 20:38 ` pinskia at gcc dot gnu dot org
2005-05-09 20:41 ` pinskia at gcc dot gnu dot org
2005-05-11 17:08 ` jakub at gcc dot gnu dot org
2005-05-17  6:52 ` cvs-commit at gcc dot gnu dot org
2005-05-17  7:11 ` cvs-commit at gcc dot gnu dot org
2005-05-17 11:26 ` 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).