public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/20912] C++ FE emitting assignments to read-only global symbols
       [not found] <bug-20912-91@http.gcc.gnu.org/bugzilla/>
@ 2005-10-11  7:21 ` mmitchel at gcc dot gnu dot org
  2005-10-11 21:06 ` mmitchel at gcc dot gnu dot org
                   ` (13 subsequent siblings)
  14 siblings, 0 replies; 22+ messages in thread
From: mmitchel at gcc dot gnu dot org @ 2005-10-11  7:21 UTC (permalink / raw)
  To: gcc-bugs



-- 

mmitchel at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         AssignedTo|unassigned at gcc dot gnu   |mark at codesourcery dot com
                   |dot org                     |
             Status|NEW                         |ASSIGNED


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


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

* [Bug c++/20912] C++ FE emitting assignments to read-only global symbols
       [not found] <bug-20912-91@http.gcc.gnu.org/bugzilla/>
  2005-10-11  7:21 ` [Bug c++/20912] C++ FE emitting assignments to read-only global symbols mmitchel at gcc dot gnu dot org
@ 2005-10-11 21:06 ` mmitchel at gcc dot gnu dot org
  2005-10-11 21:07 ` mmitchel at gcc dot gnu dot org
                   ` (12 subsequent siblings)
  14 siblings, 0 replies; 22+ messages in thread
From: mmitchel at gcc dot gnu dot org @ 2005-10-11 21:06 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #6 from mmitchel at gcc dot gnu dot org  2005-10-11 21:06 -------
Created an attachment (id=9973)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=9973&action=view)
Proposed patch


-- 


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


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

* [Bug c++/20912] C++ FE emitting assignments to read-only global symbols
       [not found] <bug-20912-91@http.gcc.gnu.org/bugzilla/>
  2005-10-11  7:21 ` [Bug c++/20912] C++ FE emitting assignments to read-only global symbols mmitchel at gcc dot gnu dot org
  2005-10-11 21:06 ` mmitchel at gcc dot gnu dot org
@ 2005-10-11 21:07 ` mmitchel at gcc dot gnu dot org
  2005-10-12 14:16 ` dnovillo at redhat dot com
                   ` (11 subsequent siblings)
  14 siblings, 0 replies; 22+ messages in thread
From: mmitchel at gcc dot gnu dot org @ 2005-10-11 21:07 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #7 from mmitchel at gcc dot gnu dot org  2005-10-11 21:07 -------
I believe the patch attached will fix the problem.

Diego, will this allow you to reactivate your optimization?  And, if so, what
kind of code will be improved?


-- 


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


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

* [Bug c++/20912] C++ FE emitting assignments to read-only global symbols
       [not found] <bug-20912-91@http.gcc.gnu.org/bugzilla/>
                   ` (2 preceding siblings ...)
  2005-10-11 21:07 ` mmitchel at gcc dot gnu dot org
@ 2005-10-12 14:16 ` dnovillo at redhat dot com
  2005-10-12 14:55 ` mark at codesourcery dot com
                   ` (10 subsequent siblings)
  14 siblings, 0 replies; 22+ messages in thread
From: dnovillo at redhat dot com @ 2005-10-12 14:16 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #8 from dnovillo at redhat dot com  2005-10-12 14:16 -------
Subject: Re:  C++ FE emitting assignments to read-only global symbols

On Tuesday 11 October 2005 17:07, mmitchel at gcc dot gnu dot org wrote:

> Diego, will this allow you to reactivate your optimization?  And, if so,
> what kind of code will be improved?
>
Thanks Mark.  The underlying code has shifted in the interim.  There was 
another bug that would cause us to ICE with code that specifically casted 
away constness.  We now should get this micro-optimization on the cases we 
cared for (call-clobbering situations, mostly).


-- 


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


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

* [Bug c++/20912] C++ FE emitting assignments to read-only global symbols
       [not found] <bug-20912-91@http.gcc.gnu.org/bugzilla/>
                   ` (3 preceding siblings ...)
  2005-10-12 14:16 ` dnovillo at redhat dot com
@ 2005-10-12 14:55 ` mark at codesourcery dot com
  2005-10-12 15:00 ` dnovillo at redhat dot com
                   ` (9 subsequent siblings)
  14 siblings, 0 replies; 22+ messages in thread
From: mark at codesourcery dot com @ 2005-10-12 14:55 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #9 from mark at codesourcery dot com  2005-10-12 14:55 -------
Subject: Re:  C++ FE emitting assignments to read-only global
 symbols

dnovillo at redhat dot com wrote:

> Thanks Mark.  The underlying code has shifted in the interim.  There was 
> another bug that would cause us to ICE with code that specifically casted 
> away constness.  We now should get this micro-optimization on the cases we 
> cared for (call-clobbering situations, mostly).

OK, so my patch is no longer directly useful then?  (It still seems like
it would be an improvement in the abstract, in that assigning to
TREE_READONLY variables is evil, but if it won't have any immediate
tangible benefit, I'll leave this for 4.2.)


-- 


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


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

* [Bug c++/20912] C++ FE emitting assignments to read-only global symbols
       [not found] <bug-20912-91@http.gcc.gnu.org/bugzilla/>
                   ` (4 preceding siblings ...)
  2005-10-12 14:55 ` mark at codesourcery dot com
@ 2005-10-12 15:00 ` dnovillo at redhat dot com
  2005-10-28 18:25 ` pinskia at gcc dot gnu dot org
                   ` (8 subsequent siblings)
  14 siblings, 0 replies; 22+ messages in thread
From: dnovillo at redhat dot com @ 2005-10-12 15:00 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #10 from dnovillo at redhat dot com  2005-10-12 15:00 -------
Subject: Re:  C++ FE emitting assignments to read-only global symbols

On Wednesday 12 October 2005 10:55, mark at codesourcery dot com wrote:

> OK, so my patch is no longer directly useful then?  (It still seems like
> it would be an improvement in the abstract, in that assigning to
> TREE_READONLY variables is evil, but if it won't have any immediate
> tangible benefit, I'll leave this for 4.2.)
>
Leaving it for 4.2 should be fine.  It is only a micro-optimization and I 
only noticed it by chance because we were being too aggressive with it.  
Yes, it's nice to stop the FE from generating stores to TREE_READONLY, but 
it's not the end of the world for 4.1.

Thanks.


-- 


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


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

* [Bug c++/20912] C++ FE emitting assignments to read-only global symbols
       [not found] <bug-20912-91@http.gcc.gnu.org/bugzilla/>
                   ` (5 preceding siblings ...)
  2005-10-12 15:00 ` dnovillo at redhat dot com
@ 2005-10-28 18:25 ` pinskia at gcc dot gnu dot org
  2007-02-03 18:36 ` steven at gcc dot gnu dot org
                   ` (7 subsequent siblings)
  14 siblings, 0 replies; 22+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-10-28 18:25 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #11 from pinskia at gcc dot gnu dot org  2005-10-28 18:25 -------
Right now after fixing this and PR 23777 should become fixed.


-- 

pinskia at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
OtherBugsDependingO|                            |23777
              nThis|                            |


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


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

* [Bug c++/20912] C++ FE emitting assignments to read-only global symbols
       [not found] <bug-20912-91@http.gcc.gnu.org/bugzilla/>
                   ` (6 preceding siblings ...)
  2005-10-28 18:25 ` pinskia at gcc dot gnu dot org
@ 2007-02-03 18:36 ` steven at gcc dot gnu dot org
  2007-02-05  3:19 ` mark at codesourcery dot com
                   ` (6 subsequent siblings)
  14 siblings, 0 replies; 22+ messages in thread
From: steven at gcc dot gnu dot org @ 2007-02-03 18:36 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #12 from steven at gcc dot gnu dot org  2007-02-03 18:35 -------
Mark was going to leave this for GCC 4.2, but hasn't fixed this for GCC 4.2
yet, either.  What's going to happen with this bug?


-- 

steven at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |steven at gcc dot gnu dot
                   |                            |org


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


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

* [Bug c++/20912] C++ FE emitting assignments to read-only global symbols
       [not found] <bug-20912-91@http.gcc.gnu.org/bugzilla/>
                   ` (7 preceding siblings ...)
  2007-02-03 18:36 ` steven at gcc dot gnu dot org
@ 2007-02-05  3:19 ` mark at codesourcery dot com
  2007-02-05 22:30 ` steven at gcc dot gnu dot org
                   ` (5 subsequent siblings)
  14 siblings, 0 replies; 22+ messages in thread
From: mark at codesourcery dot com @ 2007-02-05  3:19 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #13 from mark at codesourcery dot com  2007-02-05 03:18 -------
Subject: Re:  C++ FE emitting assignments to read-only global
 symbols

steven at gcc dot gnu dot org wrote:

> Mark was going to leave this for GCC 4.2, but hasn't fixed this for GCC 4.2
> yet, either.  What's going to happen with this bug?

After Diego's comments, it didn't sound like it was still important to
fix it.

Does the patch in Comment #6 still apply?  It looks like to me as if it
would (at least in principle; the code affected still looks the same).
If so, it's OK to apply to mainline, assuming test results go OK.  Would
you like to test it?

If that fix will also fix PR 23777, then the same fix is also OK for
4.2.  If not, then is there any compelling reason to apply it to 4.2?

Thanks,


-- 


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


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

* [Bug c++/20912] C++ FE emitting assignments to read-only global symbols
       [not found] <bug-20912-91@http.gcc.gnu.org/bugzilla/>
                   ` (8 preceding siblings ...)
  2007-02-05  3:19 ` mark at codesourcery dot com
@ 2007-02-05 22:30 ` steven at gcc dot gnu dot org
  2007-02-05 22:46 ` steven at gcc dot gnu dot org
                   ` (4 subsequent siblings)
  14 siblings, 0 replies; 22+ messages in thread
From: steven at gcc dot gnu dot org @ 2007-02-05 22:30 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #14 from steven at gcc dot gnu dot org  2007-02-05 22:30 -------
I don't think there is a compelling reason to have the patch in GCC 4.2.  But
it would still be nice to get this out of the way, to reduce the number of VOPs
a bit further.

I have updated the patch of comment #6 and I'll test it (on x86_64/i686)
somewhen later this week.


-- 


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


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

* [Bug c++/20912] C++ FE emitting assignments to read-only global symbols
       [not found] <bug-20912-91@http.gcc.gnu.org/bugzilla/>
                   ` (9 preceding siblings ...)
  2007-02-05 22:30 ` steven at gcc dot gnu dot org
@ 2007-02-05 22:46 ` steven at gcc dot gnu dot org
  2007-02-05 22:51 ` rguenth at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  14 siblings, 0 replies; 22+ messages in thread
From: steven at gcc dot gnu dot org @ 2007-02-05 22:46 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #15 from steven at gcc dot gnu dot org  2007-02-05 22:46 -------
Closing as DONTCARE, by request from Diego :-)


-- 

steven at gcc dot gnu dot org changed:

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


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


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

* [Bug c++/20912] C++ FE emitting assignments to read-only global symbols
       [not found] <bug-20912-91@http.gcc.gnu.org/bugzilla/>
                   ` (10 preceding siblings ...)
  2007-02-05 22:46 ` steven at gcc dot gnu dot org
@ 2007-02-05 22:51 ` rguenth at gcc dot gnu dot org
  2007-02-05 22:51 ` rguenth at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  14 siblings, 0 replies; 22+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2007-02-05 22:51 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #17 from rguenth at gcc dot gnu dot org  2007-02-05 22:51 -------
... to mark as WONTFIX.


-- 

rguenth at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|REOPENED                    |RESOLVED
         Resolution|                            |WONTFIX


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


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

* [Bug c++/20912] C++ FE emitting assignments to read-only global symbols
       [not found] <bug-20912-91@http.gcc.gnu.org/bugzilla/>
                   ` (11 preceding siblings ...)
  2007-02-05 22:51 ` rguenth at gcc dot gnu dot org
@ 2007-02-05 22:51 ` rguenth at gcc dot gnu dot org
  2007-02-07  0:56 ` schlie at comcast dot net
  2007-05-04  0:30 ` pinskia at gcc dot gnu dot org
  14 siblings, 0 replies; 22+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2007-02-05 22:51 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #16 from rguenth at gcc dot gnu dot org  2007-02-05 22:51 -------
Reopen ...


-- 

rguenth at gcc dot gnu dot org changed:

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


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


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

* [Bug c++/20912] C++ FE emitting assignments to read-only global symbols
       [not found] <bug-20912-91@http.gcc.gnu.org/bugzilla/>
                   ` (12 preceding siblings ...)
  2007-02-05 22:51 ` rguenth at gcc dot gnu dot org
@ 2007-02-07  0:56 ` schlie at comcast dot net
  2007-05-04  0:30 ` pinskia at gcc dot gnu dot org
  14 siblings, 0 replies; 22+ messages in thread
From: schlie at comcast dot net @ 2007-02-07  0:56 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #18 from schlie at comcast dot net  2007-02-07 00:56 -------
Subject: Re:  C++ FE emitting assignments to read-only
 global symbols

for 4.3?


> From: rguenth at gcc dot gnu dot org <gcc-bugzilla@gcc.gnu.org>
> Reply-To: <gcc-bugzilla@gcc.gnu.org>
> Date: 5 Feb 2007 22:51:25 -0000
> To: <schlie@comcast.net>
> Subject: [Bug c++/20912] C++ FE emitting assignments to read-only global
> symbols
> 
> 
> 
> ------- Comment #17 from rguenth at gcc dot gnu dot org  2007-02-05 22:51
> -------
> ... to mark as WONTFIX.
> 
> 
> -- 
> 
> rguenth at gcc dot gnu dot org changed:
> 
>            What    |Removed                     |Added
> ----------------------------------------------------------------------------
>              Status|REOPENED                    |RESOLVED
>          Resolution|                            |WONTFIX
> 
> 
> http://gcc.gnu.org/bugzilla/show_bug.cgi?id=20912
> 
> ------- You are receiving this mail because: -------
> You are on the CC list for the bug, or are watching someone who is.


-- 


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


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

* [Bug c++/20912] C++ FE emitting assignments to read-only global symbols
       [not found] <bug-20912-91@http.gcc.gnu.org/bugzilla/>
                   ` (13 preceding siblings ...)
  2007-02-07  0:56 ` schlie at comcast dot net
@ 2007-05-04  0:30 ` pinskia at gcc dot gnu dot org
  14 siblings, 0 replies; 22+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2007-05-04  0:30 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #19 from pinskia at gcc dot gnu dot org  2007-05-04 01:30 -------
One more case where C++ front-end is doing this still is located in PR 31809.


-- 

pinskia at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
OtherBugsDependingO|                            |31809
              nThis|                            |


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


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

* [Bug c++/20912] C++ FE emitting assignments to read-only global symbols
  2005-04-09  1:52 [Bug c++/20912] New: " dnovillo at gcc dot gnu dot org
                   ` (5 preceding siblings ...)
  2005-04-28  2:46 ` matz at suse dot de
@ 2005-07-18  4:42 ` pinskia at gcc dot gnu dot org
  6 siblings, 0 replies; 22+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-07-18  4:42 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2005-07-18 01:37 -------
I wonder if this is the recent regression in eon again.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
   Last reconfirmed|2005-04-09 12:48:41         |2005-07-18 01:37:49
               date|                            |


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


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

* [Bug c++/20912] C++ FE emitting assignments to read-only global symbols
  2005-04-09  1:52 [Bug c++/20912] New: " dnovillo at gcc dot gnu dot org
                   ` (4 preceding siblings ...)
  2005-04-28  2:11 ` pinskia at gcc dot gnu dot org
@ 2005-04-28  2:46 ` matz at suse dot de
  2005-07-18  4:42 ` pinskia at gcc dot gnu dot org
  6 siblings, 0 replies; 22+ messages in thread
From: matz at suse dot de @ 2005-04-28  2:46 UTC (permalink / raw)
  To: gcc-bugs



-- 
Bug 20912 depends on bug 21089, which changed state.

Bug 21089 Summary: [4.0/4.1 Regression] C++ front-end does not "inline" the static const double
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=21089

           What    |Old Value                   |New Value
----------------------------------------------------------------------------
             Status|RESOLVED                    |REOPENED
         Resolution|DUPLICATE                   |

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


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

* [Bug c++/20912] C++ FE emitting assignments to read-only global symbols
  2005-04-09  1:52 [Bug c++/20912] New: " dnovillo at gcc dot gnu dot org
                   ` (3 preceding siblings ...)
  2005-04-18 19:29 ` schlie at comcast dot net
@ 2005-04-28  2:11 ` pinskia at gcc dot gnu dot org
  2005-04-28  2:46 ` matz at suse dot de
  2005-07-18  4:42 ` pinskia at gcc dot gnu dot org
  6 siblings, 0 replies; 22+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-04-28  2:11 UTC (permalink / raw)
  To: gcc-bugs



-- 
Bug 20912 depends on bug 21089, which changed state.

Bug 21089 Summary: [4.0/4.1 Regression] C++ front-end does not "inline" the static const double
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=21089

           What    |Old Value                   |New Value
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |DUPLICATE

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


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

* [Bug c++/20912] C++ FE emitting assignments to read-only global symbols
  2005-04-09  1:52 [Bug c++/20912] New: " dnovillo at gcc dot gnu dot org
                   ` (2 preceding siblings ...)
  2005-04-18 17:56 ` pinskia at gcc dot gnu dot org
@ 2005-04-18 19:29 ` schlie at comcast dot net
  2005-04-28  2:11 ` pinskia at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 22+ messages in thread
From: schlie at comcast dot net @ 2005-04-18 19:29 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From schlie at comcast dot net  2005-04-18 19:29 -------
(In reply to comment #3)
> Simple code which shows we now have a missed optimization:
> static const double a = 1.0;
> static const double b = a+1.0;
> 
> double c()
> {
>   return b;
> }
> 
> See PR 21089.

I believe the optimization necessitates the variable's declaration be changed
(either explicitly, or by implication):

 static const double b = a+1.0; => const double b = a+1.0;

If it's static-const value can't be pre-computed at compile time. (as opposed
to allowing a non-const-literal value to initialize a global static const object).


-- 


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


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

* [Bug c++/20912] C++ FE emitting assignments to read-only global symbols
  2005-04-09  1:52 [Bug c++/20912] New: " dnovillo at gcc dot gnu dot org
  2005-04-09 12:48 ` [Bug c++/20912] " pinskia at gcc dot gnu dot org
  2005-04-14 21:29 ` schlie at comcast dot net
@ 2005-04-18 17:56 ` pinskia at gcc dot gnu dot org
  2005-04-18 19:29 ` schlie at comcast dot net
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 22+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-04-18 17:56 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2005-04-18 17:56 -------
Simple code which shows we now have a missed optimization:
static const double a = 1.0;
static const double b = a+1.0;

double c()
{
  return b;
}

See PR 21089.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
  BugsThisDependsOn|                            |21089
Bug 20912 depends on bug 21089, which changed state.

Bug 21089 Summary: [4.0/4.1 Regression] C++ front-end does not "inline" the static const double
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=21089

           What    |Old Value                   |New Value
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|                            |DUPLICATE
             Status|RESOLVED                    |UNCONFIRMED
         Resolution|DUPLICATE                   |
             Status|UNCONFIRMED                 |NEWBug 20912 depends on bug 21089, which changed state.

Bug 21089 Summary: [4.0/4.1 Regression] C++ front-end does not "inline" the static const double
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=21089

           What    |Old Value                   |New Value
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|                            |DUPLICATE
             Status|RESOLVED                    |UNCONFIRMED
         Resolution|DUPLICATE                   |
             Status|UNCONFIRMED                 |NEW

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


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

* [Bug c++/20912] C++ FE emitting assignments to read-only global symbols
  2005-04-09  1:52 [Bug c++/20912] New: " dnovillo at gcc dot gnu dot org
  2005-04-09 12:48 ` [Bug c++/20912] " pinskia at gcc dot gnu dot org
@ 2005-04-14 21:29 ` schlie at comcast dot net
  2005-04-18 17:56 ` pinskia at gcc dot gnu dot org
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 22+ messages in thread
From: schlie at comcast dot net @ 2005-04-14 21:29 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From schlie at comcast dot net  2005-04-14 21:28 -------
(In reply to comment #0)

I guess I misunderstand the problem, as given:

  const double ggPi = 3.14159265358979323846;
  double const divPi = 1 / ggPi;

It would seem that neither ggPi or divPI should be designated "unchanging"
at the tree/rtl level, as neither are global static const objects, although:

  3.14159265358979323846

is, if stored as a value; as opposed to being inlined in the code as an immediate.

ggPi and divPi are simply variables which are initialized with values at runtime;
where the fact that they're "const" has prevented an assignment (other than an
initializing one) being accepted as valid during semantic analysis.  Where post
semantic analysis, they're just variables just like any others which happen to
have no assignments specified post initialization (as enforced by the front end);
so should not be marked READONLY/unchanging to begin with, it would seem?


-- 


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


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

* [Bug c++/20912] C++ FE emitting assignments to read-only global symbols
  2005-04-09  1:52 [Bug c++/20912] New: " dnovillo at gcc dot gnu dot org
@ 2005-04-09 12:48 ` pinskia at gcc dot gnu dot org
  2005-04-14 21:29 ` schlie at comcast dot net
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 22+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-04-09 12:48 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2005-04-09 12:48 -------
Confirmed.

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


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


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

end of thread, other threads:[~2007-05-04  0:30 UTC | newest]

Thread overview: 22+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <bug-20912-91@http.gcc.gnu.org/bugzilla/>
2005-10-11  7:21 ` [Bug c++/20912] C++ FE emitting assignments to read-only global symbols mmitchel at gcc dot gnu dot org
2005-10-11 21:06 ` mmitchel at gcc dot gnu dot org
2005-10-11 21:07 ` mmitchel at gcc dot gnu dot org
2005-10-12 14:16 ` dnovillo at redhat dot com
2005-10-12 14:55 ` mark at codesourcery dot com
2005-10-12 15:00 ` dnovillo at redhat dot com
2005-10-28 18:25 ` pinskia at gcc dot gnu dot org
2007-02-03 18:36 ` steven at gcc dot gnu dot org
2007-02-05  3:19 ` mark at codesourcery dot com
2007-02-05 22:30 ` steven at gcc dot gnu dot org
2007-02-05 22:46 ` steven at gcc dot gnu dot org
2007-02-05 22:51 ` rguenth at gcc dot gnu dot org
2007-02-05 22:51 ` rguenth at gcc dot gnu dot org
2007-02-07  0:56 ` schlie at comcast dot net
2007-05-04  0:30 ` pinskia at gcc dot gnu dot org
2005-04-09  1:52 [Bug c++/20912] New: " dnovillo at gcc dot gnu dot org
2005-04-09 12:48 ` [Bug c++/20912] " pinskia at gcc dot gnu dot org
2005-04-14 21:29 ` schlie at comcast dot net
2005-04-18 17:56 ` pinskia at gcc dot gnu dot org
2005-04-18 19:29 ` schlie at comcast dot net
2005-04-28  2:11 ` pinskia at gcc dot gnu dot org
2005-04-28  2:46 ` matz at suse dot de
2005-07-18  4:42 ` 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).