public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug middle-end/35783]  New: non address exposed static variable can not be used/modified by external functions
@ 2008-04-01  1:20 xinliangli at gmail dot com
  2008-04-01  1:25 ` [Bug middle-end/35783] " pinskia at gcc dot gnu dot org
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: xinliangli at gmail dot com @ 2008-04-01  1:20 UTC (permalink / raw)
  To: gcc-bugs

In the following example, ss should be constant propagated, but gcc does not do
it.


static int ss = 0;

extern bar();

int foo()
{
  ss = 10;
  bar();
  return ss;
}


-- 
           Summary: non address exposed static variable can not be
                    used/modified by external functions
           Product: gcc
           Version: 4.4.0
            Status: UNCONFIRMED
          Severity: enhancement
          Priority: P3
         Component: middle-end
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: xinliangli at gmail dot com


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


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

* [Bug middle-end/35783] non address exposed static variable can not be used/modified by external functions
  2008-04-01  1:20 [Bug middle-end/35783] New: non address exposed static variable can not be used/modified by external functions xinliangli at gmail dot com
@ 2008-04-01  1:25 ` pinskia at gcc dot gnu dot org
  2008-04-01  1:27 ` [Bug middle-end/35783] non address exposed static variable can not be changed by external function to a different value pinskia at gcc dot gnu dot org
  2008-04-01  4:56 ` xinliangli at gmail dot com
  2 siblings, 0 replies; 4+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2008-04-01  1:25 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from pinskia at gcc dot gnu dot org  2008-04-01 01:24 -------
This need super powerful IPA based call clobberness.  Basically we need to
detect there is only one value that ss can hold inside foo even with the call
to bar, that is a hard problem really.


-- 

pinskia at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|0                           |1
           Keywords|                            |alias
   Last reconfirmed|0000-00-00 00:00:00         |2008-04-01 01:24:30
               date|                            |


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


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

* [Bug middle-end/35783] non address exposed static variable can not be changed by external function to a different value
  2008-04-01  1:20 [Bug middle-end/35783] New: non address exposed static variable can not be used/modified by external functions xinliangli at gmail dot com
  2008-04-01  1:25 ` [Bug middle-end/35783] " pinskia at gcc dot gnu dot org
@ 2008-04-01  1:27 ` pinskia at gcc dot gnu dot org
  2008-04-01  4:56 ` xinliangli at gmail dot com
  2 siblings, 0 replies; 4+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2008-04-01  1:27 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from pinskia at gcc dot gnu dot org  2008-04-01 01:26 -------
and it can be modified by an extern function, just it will be the same value as
it was at the point bar was called.


-- 

pinskia at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|non address exposed static  |non address exposed static
                   |variable can not be         |variable can not be changed
                   |used/modified by external   |by external function to a
                   |functions                   |different value


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


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

* [Bug middle-end/35783] non address exposed static variable can not be changed by external function to a different value
  2008-04-01  1:20 [Bug middle-end/35783] New: non address exposed static variable can not be used/modified by external functions xinliangli at gmail dot com
  2008-04-01  1:25 ` [Bug middle-end/35783] " pinskia at gcc dot gnu dot org
  2008-04-01  1:27 ` [Bug middle-end/35783] non address exposed static variable can not be changed by external function to a different value pinskia at gcc dot gnu dot org
@ 2008-04-01  4:56 ` xinliangli at gmail dot com
  2 siblings, 0 replies; 4+ messages in thread
From: xinliangli at gmail dot com @ 2008-04-01  4:56 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from xinliangli at gmail dot com  2008-04-01 04:55 -------
Silly bug. bar can call back any function in ss's module.


-- 

xinliangli at gmail dot com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |INVALID


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


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

end of thread, other threads:[~2008-04-01  4:56 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-04-01  1:20 [Bug middle-end/35783] New: non address exposed static variable can not be used/modified by external functions xinliangli at gmail dot com
2008-04-01  1:25 ` [Bug middle-end/35783] " pinskia at gcc dot gnu dot org
2008-04-01  1:27 ` [Bug middle-end/35783] non address exposed static variable can not be changed by external function to a different value pinskia at gcc dot gnu dot org
2008-04-01  4:56 ` xinliangli at gmail dot com

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).